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

Commit e0babe7

Browse files
authored
Update README.md
1 parent 6b71a3d commit e0babe7

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
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+
# RedisJSON 2
77

8-
## Usage
8+
RedisJSON 2 ([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)
17+
18+
19+
## New Commands in RedisJSON 2
920

1021
JSON.INDEX ADD <index> <field> <path>
1122
JSON.INDEX DEL <index> <field>
@@ -24,9 +35,34 @@ Return value from JSON.QGET is an array of keys and values:
2435

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

38+
## Examples
39+
2740
A query combining multiple paths:
2841

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

3167

3268
## Build

0 commit comments

Comments
 (0)