Skip to content
Merged

1.2 #299

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 19 additions & 61 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "redisjson"
version = "1.9.0"
version = "1.2.0"
authors = ["Gavrie Philipson <gavrie@redislabs.com>"]
edition = "2018"

Expand All @@ -15,7 +15,6 @@ serde = "1.0"
libc = "0.2"
jsonpath_lib = { git="https://github.com/RedisJSON/jsonpath.git", branch="public-parser" }
redis-module = { version="0.11", features = ["experimental-api"]}
redisearch_api = "0.5"

[features]
# Workaround to allow cfg(feature = "test") in redismodue-rs dependencies:
Expand Down
57 changes: 0 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,63 +28,6 @@ docker run -p 6379:6379 --name redis-redisjson redislabs/rejson:latest

Read the docs at http://redisjson.io


## New Commands in RedisJSON

JSON.INDEX ADD <index> <field> <path>
JSON.INDEX DEL <index>
JSON.QGET <index> <query> <path>

* `<index>` - user defined index name
* `<path>` - [JSONPath](https://goessner.net/articles/JsonPath/) syntax for selecting elements inside documents
* `<query>` - syntax is based on [RediSearch query syntax](https://oss.redislabs.com/redisearch/Query_Syntax/)

### Next Milestone
JSON.QSET <index> <query> <path> <json> [NX | XX]
JSON.QDEL <index> <query> <path>

JSON.INDEX DEL <index> <field>
JSON.INDEX INFO <index> <field>

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

key
json
key
json

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

## Examples

A query combining multiple paths:

JSON.QGET mytype "@path1:hello @path2:world" d.name


```bash
127.0.0.1:6379> json.set user1 $ '{"last":"Joe", "first":"Mc"}' INDEX person
OK
127.0.0.1:6379> json.set user2 $ '{"last":"Joan", "first":"Mc"}' INDEX person
OK
127.0.0.1:6379> json.index add person last $.last
OK
127.0.0.1:6379> JSON.QGET person Jo*
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}]}"
127.0.0.1:6379> json.set user3 $ '{"last":"Joel", "first":"Dan"}' INDEX person
OK
127.0.0.1:6379> JSON.QGET person Jo*
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}],\"user3\":[{\"last\":\"Joel\",\"first\":\"Dan\"}]}"
127.0.0.1:6379> json.index add person first $.first
OK
127.0.0.1:6379> JSON.QGET person Mc
"{\"user2\":[{\"last\":\"Joan\",\"first\":\"Mc\"}],\"user1\":[{\"last\":\"Joe\",\"first\":\"Mc\"}]}"
127.0.0.1:6379> JSON.QGET person Mc $.last
"{\"user2\":[\"Joan\"],\"user1\":[\"Joe\"]}"
127.0.0.1:6379> JSON.QGET person "@last:Jo* @first:Mc" $.last
"{\"user2\":[\"Joan\"],\"user1\":[\"Joe\"]}"
```

## Build

Make sure you have Rust installed:
Expand Down
Loading