JSON.OBJLEN
JSON.OBJLEN key [path]
Report the number of keys in the JSON object at path in key
keyis key to parse. Returns null for nonexistent keys.
pathis 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.
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
1) (nil)
2) (integer) 2JSON.ARRINDEX | JSON.ARRINSERT
© 2006–2022 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/json.objlen/