JSON.NUMMULTBY

Syntax

  1. JSON.NUMMULTBY key path value

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

Multiply the number value stored at path by number

Examples

Required arguments

key

is key to modify.

value

is number value to multiply.

Optional arguments

path

is JSONPath to specify. Default is root $.

Return

JSON.NUMMULTBY returns a bulk string reply specified as a stringified new values for each path, or nil element if the matching JSON value is not a number. For more information about replies, see Redis serialization protocol specification.

Examples

  1. dragonfly> JSON.SET doc . '{"a":"b","b":[{"a":2}, {"a":5}, {"a":"c"}]}'
  2. OK
  3. dragonfly> JSON.NUMMULTBY doc $.a 2
  4. "[null]"
  5. dragonfly> JSON.NUMMULTBY doc $..a 2
  6. "[null,4,10,null]"

See also

JSON.NUMINCRBY | JSON.ARRINSERT