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.STRLEN behaviour doesn't match documentation, with defaults #504
Based on the documentation for JSON.STRLEN if the path isn't provided '.' is assumed. This is similar to what occurred in #502. 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.strlen 'smirf'
(error) ERR wrong number of arguments for 'json.strlen' command
127.0.0.1:36379> json.arrlen 'strlen' .
(nil)
127.0.0.1:36379> json.arrlen 'strlen'
(error) ERR wrong number of arguments for 'json.strlen' command
127.0.0.1:36379>
In our second example - when setting a value, and attempting to run an strlen 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.strlen foo
(error) ERR wrong number of arguments for 'json.strlen' command
127.0.0.1:36379> json.strlen foo .
(integer) 5
Activity