JSON.ARRPOP
Since 1.1.0JSON
Syntax
JSON.ARRPOP key [path [index]]Removes and returns an element from each array path matches: the last one, or the one at index. An index out of range takes the nearest end.
Reply
- The elements removed, as JSON text.
Examples
> JSON.SET d $ '{"tags":["first","math","code"]}'
OK
> JSON.ARRPOP d $.tags
1) "\"code\""
> JSON.ARRPOP d $.tags 0
1) "\"first\""