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
is one or more values to append to one or more arrays.
@@ -58,16 +63,9 @@ To specify a string as an array value to append, wrap the quoted string with an
58
63
{{% /alert %}}
59
64
</details>
60
65
61
-
## Optional arguments
62
-
63
-
<detailsopen><summary><code>path</code></summary>
64
-
65
-
is JSONPath to specify. Default is root `$`.
66
-
</details>
67
-
68
66
## Return value
69
67
70
-
`JSON.ARRAPPEND` returns an [array]({{< relref "develop/reference/protocol-spec#resp-arrays" >}}) of integer replies for each path, the array's new size, or `nil`, if the matching JSON value is not an array.
68
+
`JSON.ARRAPPEND` returns an [array]({{< relref "develop/reference/protocol-spec#resp-arrays" >}}) of integer replies for each `path` match, the array's new length, or `nil`, if the matching JSON value is not an array.
71
69
For more information about replies, see [Redis serialization protocol specification]({{< relref "/develop/reference/protocol-spec" >}}).
Add color `blue` to the end of the `colors` array. `JSON.ARRAPPEND` returns the array's new size.
83
+
Add color `blue` to the end of the `colors` array. `JSON.ARRAPPEND`; Return the new length of the `colors` array.
86
84
87
85
{{< highlight bash >}}
88
86
redis> JSON.ARRAPPEND item:1 $.colors '"blue"'
89
87
1) (integer) 3
90
88
{{< / highlight >}}
91
89
92
-
Return the new length of the `colors` array.
90
+
Get the updated value of the `colors` array.
93
91
94
92
{{< highlight bash >}}
95
-
redis> JSON.GET item:1
96
-
"{\"name\":\"Noise-cancelling Bluetooth headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\",\"blue\"]}"
0 commit comments