JSON.STRAPPEND key [path] value
@json,
@write,
@slow,
Append the json-string values to the string at path
keyis key to modify.
valueis value to append to one or more strings.
'"silver"'. For more detailed use, see Examples.pathis JSONPath to specify. Default is root $.
redis> JSON.SET doc $ '{"a":"foo", "nested": {"a": "hello"}, "nested2": {"a": 31}}'
OK
redis> JSON.STRAPPEND doc $..a '"baz"'
1) (integer) 6
2) (integer) 8
3) (nil)
redis> JSON.GET doc $
"[{\"a\":\"foobaz\",\"nested\":{\"a\":\"hellobaz\"},\"nested2\":{\"a\":31}}]"| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Supported |
✅ Flexible & Annual ✅ Free & Fixed |
With $-based path argument: Array reply of integer replies or null replies, where each element is the string's new length, or null if the matching value is not a string.
With .-based path argument: Integer reply representing the string's new length, or null reply if the matching value is not a string.
JSON.ARRAPEND | JSON.ARRINSERT