Use JSON.NUMMULTBY to multiply the numeric values a path selects by a number.
The multiplier may be a fraction to scale values down, and the update is atomic. The reply is the new value of each match, and a match that is not a number returns an error. It is the multiplicative counterpart of JSON.NUMINCRBY, useful for applying percentage changes such as a discount to every price in a document.
Syntax#
Arguments#
| Argument | Required | Repeatable | Description |
|---|---|---|---|
key | Yes | No | JSON document key. |
path | Yes | No | Path selecting numbers. |
value | Yes | No | Numeric multiplier. |
Important points#
- Raw TCP examples pass JSON values as valid JSON text. Typed Upstash SDK helpers serialize native objects and values for you.
- Paths beginning with
$use JSONPath and can match multiple values, so many JSON commands return an array of per-match results.
Response#
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
| Protocol | Reply |
|---|---|
| RESP2 | Bulk string containing a JSON number or array |
| RESP3 | Bulk string containing a JSON number or array |
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples#
TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.