Report the number of keys in the JSON object at path
in key
key
is key to parse. Returns null
for nonexistent keys.
path
is JSONPath to specify. Default is root $
. Returns null
for nonexistant path.
JSON.OBJLEN returns an array of integer replies for each path specified as the number of keys in the object or nil
, if the matching JSON value is not an object.
For more information about replies, see Redis serialization protocol specification.
{{< highlight bash >}} 127.0.0.1:6379> JSON.SET doc $ '{"a":[3], "nested": {"a": {"b":2, "c": 1}}}' OK 127.0.0.1:6379> JSON.OBJLEN doc $..a
- (nil)
- (integer) 2 {{< / highlight >}}
JSON.ARRINDEX
| JSON.ARRINSERT