Skip to content
This repository was archived by the owner on Apr 20, 2020. It is now read-only.

Commit 982cbac

Browse files
committed
Merge branch 'master' of github.com:RedisLabsModules/RedisDoc
2 parents b3ca97b + ef2083a commit 982cbac

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

README.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1-
[![GitHub issues](https://img.shields.io/github/release/RedisJSON/RedisDoc.svg)](https://github.com/RedisJSON/RedisDoc/releases/latest)
2-
[![CircleCI](https://circleci.com/gh/RedisJSON/RedisDoc/tree/master.svg?style=svg)](https://circleci.com/gh/RedisJSON/RedisDoc/tree/master)
1+
[![GitHub issues](https://img.shields.io/github/release/RedisJSON/RedisJSON2.svg)](https://github.com/RedisJSON/RedisJSON2/releases/latest)
2+
[![CircleCI](https://circleci.com/gh/RedisJSON/RedisJSON2/tree/master.svg?style=svg)](https://circleci.com/gh/RedisJSON/RedisJSON2/tree/master)
33
[![Mailing List](https://img.shields.io/badge/Mailing%20List-RedisJSON-blue)](https://groups.google.com/forum/#!forum/redisjson)
44
[![Gitter](https://badges.gitter.im/RedisLabs/RedisJSON.svg)](https://gitter.im/RedisLabs/RedisJSON?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
55

6-
# RedisJSON
6+
# RedisJSON2
77

8-
## Usage
8+
RedisJSON2 ([RedisJSON](https://github.com/RedisJSON/RedisJSON) nextgen) is a [Redis](https://redis.io/) module that implements [ECMA-404 The JSON Data Interchange Standard](http://json.org/) as a native data type. It allows storing, updating and fetching JSON values from Redis keys (documents).
9+
10+
## Primary features:
11+
12+
* Full support of the JSON standard
13+
* [JSONPath](http://goessner.net/articles/JsonPath/) syntax for selecting elements inside documents
14+
* Documents are stored as binary data in a tree structure, allowing fast access to sub-elements
15+
* Typed atomic operations for all JSON values types
16+
* Secondery index support based on [RediSeach](http://redisearch.io)
917

10-
JSON.INDEX ADD <index> <field> <path>
11-
JSON.INDEX DEL <index> <field>
12-
JSON.INDEX INFO <index> <field>
1318

19+
## New Commands in RedisJSON2
20+
21+
JSON.INDEX ADD <index> <field> <path>
1422
JSON.QGET <index> <query> <path>
23+
24+
### Next Milestone
1525
JSON.QSET <index> <query> <path> <json> [NX | XX]
1626
JSON.QDEL <index> <query> <path>
27+
28+
JSON.INDEX DEL <index> <field>
29+
JSON.INDEX INFO <index> <field>
1730

1831
Return value from JSON.QGET is an array of keys and values:
1932

@@ -24,9 +37,34 @@ Return value from JSON.QGET is an array of keys and values:
2437

2538
In a language such as Java this could be represented as a `Map<String, Document>`.
2639

40+
## Examples
41+
2742
A query combining multiple paths:
2843

2944
JSON.QGET mytype "@path1:hello @path2:world" d.name
45+
46+
47+
```bash
48+
127.0.0.1:6379> json.set user1 $ '{"last":"Joe", "first":"Mc"}' INDEX person
49+
OK
50+
127.0.0.1:6379> json.set user2 $ '{"last":"Joan", "first":"Mc"}' INDEX person
51+
OK
52+
127.0.0.1:6379> json.index add person last $.last
53+
OK
54+
127.0.0.1:6379> JSON.QGET person Jo*
55+
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}]}"
56+
127.0.0.1:6379> json.set user3 $ '{"last":"Joel", "first":"Dan"}' INDEX person
57+
OK
58+
127.0.0.1:6379> JSON.QGET person Jo*
59+
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}],\"user3\":[{\"last\":\"Joel\",\"first\":\"Dan\"}]}"
60+
127.0.0.1:6379> json.index add person first $.first
61+
OK
62+
127.0.0.1:6379> JSON.QGET person Mc
63+
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}]}"
64+
127.0.0.1:6379> JSON.QGET person Mc $.last
65+
"{\"user2\":[\"Joan\"],\"user1\":[\"Joe\"]}"
66+
```
67+
3068

3169

3270
## Build

0 commit comments

Comments
 (0)