Return the JSON in key
in Redis serialization protocol specification form
key
is key to parse.
path
is JSONPath to specify. Default is root $
. This command uses the following mapping from JSON to RESP:
- JSON
null
maps to the bulk string reply. - JSON
false
andtrue
values map to the simple string reply. - JSON number maps to the integer reply or bulk string reply, depending on type.
- JSON string maps to the bulk string reply.
- JSON array is represented as an array reply in which the first element is the simple string reply
[
, followed by the array's elements. - JSON object is represented as an array reply in which the first element is the simple string reply
{
. Each successive entry represents a key-value pair as a two-entry array reply of the bulk string reply.
For more information about replies, see Redis serialization protocol specification.
JSON.RESP returns an array reply specified as the JSON's RESP form detailed in Redis serialization protocol specification.
Return an array of RESP details about a document
Create a JSON document.
{{< highlight bash >}} 127.0.0.1:6379> JSON.SET item:2 $ '{"name":"Wireless earbuds","description":"Wireless Bluetooth in-ear headphones","connection":{"wireless":true,"type":"Bluetooth"},"price":64.99,"stock":17,"colors":["black","white"], "max_level":[80, 100, 120]}' OK {{< / highlight >}}
Get all RESP details about the document.
{{< highlight bash >}} 127.0.0.1:6379> JSON.RESP item:2
- {
- "name"
- "Wireless earbuds"
- "description"
- "Wireless Bluetooth in-ear headphones"
- "connection"
-
- {
- "wireless"
- true
- "type"
- "Bluetooth"
- "price"
- "64.989999999999995"
- "stock"
- (integer) 17
- "colors"
-
- [
- "black"
- "white"
- "max_level"
-
- [
- (integer) 80
- (integer) 100
- (integer) 120 {{< / highlight >}}
JSON.SET
| JSON.ARRLEN