JSON.ARRINSERT

Since 1.1.0JSON

Syntax

JSON.ARRINSERT key path index value [value ...]
  • Flags: write
  • ACL categories: @json, @slow, @write
  • Arity: -2

Inserts values, each JSON text, before index in each array path matches. Negative indexes count from the end.

Reply

  • The new lengths.

Examples

> JSON.SET d $ '{"tags":["math","code"]}'
OK
> JSON.ARRINSERT d $.tags 0 '"first"'
1) (integer) 3