JSON.ARRTRIM
Since 1.1.0JSON
Syntax
JSON.ARRTRIM key path start stopKeeps only the elements from start to stop, both included, in each array path matches.
Reply
- The new lengths.
Examples
> JSON.SET d $ '{"tags":["a","b","c","d"]}'
OK
> JSON.ARRTRIM d $.tags 0 1
1) (integer) 2
> JSON.GET d $.tags
"[[\"a\",\"b\"]]"