You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON.ARRLEN behaviour doesn't match documentation, with defaults #502
Based on the documentation for JSON.ARRLEN if the path isn't provided '.' is assumed. Similarly if a key is not provided, a null should be returned:
path defaults to root if not provided. If the key or path do not exist, null is returned.
But, using our example below, when testing with a key that does not exist an error is raised, instead of None.
127.0.0.1:36379> json.arrlen 'smirf'
(error) ERR wrong number of arguments for 'json.arrlen' command
127.0.0.1:36379> json.arrlen 'smirf' .
(nil)
127.0.0.1:36379> json.arrlen 'smirf'
(error) ERR wrong number of arguments for 'json.arrlen' command
127.0.0.1:36379>
In our second example - when setting a value, and attempting to run an arrlen without specifying a path, the default path of '.' should be used. But as seen below, it was not.
127.0.0.1:36379> json.set foo . '[5,6,7,8,9]'
OK
127.0.0.1:36379> json.arrlen foo
(error) ERR wrong number of arguments for 'json.arrlen' command
127.0.0.1:36379> json.arrlen foo .
(integer) 5
Activity