JSON.OBJLEN

Since 1.1.0JSON

Syntax

JSON.OBJLEN key [path]
  • Flags: readonly
  • ACL categories: @json, @read, @slow
  • Arity: -2

Returns the number of members of each object path matches.

Examples

> JSON.SET d $ '{"name":"Ada","addr":{"city":"London"}}'
OK
> JSON.OBJLEN d
(integer) 2
> JSON.OBJLEN d $.addr
1) (integer) 1