As of JSON version 2.0, this command is regarded as deprecated.
JSON.NUMMULTBY key path value
@json,
@write,
@slow,
Multiply the number value stored at path by number
keyis key to modify.
valueis number value to multiply.
pathis JSONPath to specify. Default is root $.
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]"| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Supported |
✅ Flexible & Annual ✅ Free & Fixed |
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.
JSON.NUMINCRBY | JSON.ARRINSERT