JSON.NUMMULTBY (deprecated)
As of JSON version 2.0, this command is regarded as deprecated.
JSON.NUMMULTBY key path value
- Available in:
- Redis Open Source / JSON 1.0.0
- Time complexity:
- O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key
- ACL categories:
-
@json
,@write
,@slow
,
Multiply the number value stored at path
by number
Required arguments
key
is key to modify.
value
is number value to multiply.
Optional arguments
path
is JSONPath to specify. Default is root $
.
Examples
redis> JSON.SET doc . '{"a":"b","b":[{"a":2}, {"a":5}, {"a":"c"}]}'
OK
redis> JSON.NUMMULTBY doc $.a 2
"[null]"
redis> JSON.NUMMULTBY doc $..a 2
"[null,4,10,null]"
Return information
With $
-based path argument: Bulk string reply containing a JSON-encoded string with the new value(s), or null reply if the matching value is not a number.
With .
-based path argument: Bulk string reply representing the stringified new value, null reply if the matching value is not a number, or simple error reply on error.
See also
JSON.NUMINCRBY
| JSON.ARRINSERT