INCRBY
Since 1.1.0Strings
Syntax
INCRBY key incrementAdds increment, a signed 64-bit integer, to the integer stored at key. A negative increment subtracts. A missing key counts as 0.
Reply
- The value after the increment.
ERR increment or decrement would overflowif the result does not fit in 64 bits; the value is unchanged.ERR value is not an integer or out of rangeif the value is not an integer.
Examples
> SET n 10
OK
> INCRBY n 5
(integer) 15
> INCRBY n -20
(integer) -5
> SET big 9223372036854775807
OK
> INCRBY big 1
(error) ERR increment or decrement would overflow