Skip to content

JSON Commands

Mambisi Zempare edited this page Apr 15, 2020 · 2 revisions

Escanor Redis Extension Commands

JSET key value
JMERGE key value

the json value must escape quotes or if your are using escanor-cli you can put it in back-ticks `value`

JGET key
JPATH key xpath

Json xpath specifications can be found here

JDEL key

Example with escanor-cli

> JSET author.0 `{"name" : "Mambisi", "books" : [ "Harry Potter", "To Kill a Mockingbird", "The Great Gatsby"]}`
OK
> JMERGE author.0 `{"age" : 24}`
OK
> JGET author.0
"{"age":24,"name":"Mambisi","books":["Harry Potter","To Kill a Mockingbird","The Great Gatsby"]}"
> JPATH author.0 $.books
1) "["Harry Potter","To Kill a Mockingbird","The Great Gatsby"]"
> JPATH author.0 $.books[0]
1) ""Harry Potter""
> JDEL author.0
OK
Clone this wiki locally