This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> FT.CREATE myIdx ON JSON SCHEMA $.title AS title TEXT | |
OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.SET myDoc $ '{"title": "foo", "content": "bar"}' | |
OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.SET myDoc $ '{"books": [{"title": "Peter Pan", "price": 8.95}, {"title": "Moby Dick", "price": 12.99}]}' | |
redis.cloud:6379> JSON.GET myDoc '$.books[?(@.price < 10)]' | |
"[{\"title\":\"Peter Pan\",\"price\":8.95}]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.GET myDoc $.colors[0:2] | |
"[\"red\",\"blue\"]" | |
redis.cloud:6379> JSON.GET myDoc $.colors[-1] | |
"["\"green\"]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.GET myDoc $.colors[*] | |
"[\"red\",\"blue\",\"green\"]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.SET myDoc $ '{"colors":["red", "blue", "green"]}' | |
OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.GET myDoc . | |
"{\"title\":\"css\",\"colors\":[\"green\"]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.ARRAPPEND myDoc colors '"red"' '"blue"' | |
(integer) 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.SET myDoc title '"style"' | |
OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis.cloud:6379> JSON.SET myDoc . '{"title": "css", "colors": ["green"]}' | |
OK |