DECRBY

Since 1.1.0Strings

Syntax

DECRBY key decrement
  • Flags: fast, write
  • ACL categories: @fast, @string, @write
  • Arity: 3

Subtracts decrement, a signed 64-bit integer, from the integer stored at key. A missing key counts as 0.

Reply

  • The value after the decrement.
  • ERR increment or decrement would overflow if the result does not fit in 64 bits.
  • ERR value is not an integer or out of range if the value is not an integer.

Examples

> SET n 12
OK
> DECRBY n 3
(integer) 9