DECRBY

Syntax
DECRBY key decrement
Available since:
1.0.0
Time complexity:
O(1)
ACL categories:
@write, @string, @fast,

The DECRBY command reduces the value stored at the specified key by the specified decrement. If the key does not exist, it is initialized with a value of 0 before performing the operation. If the key's value is not of the correct type or cannot be represented as an integer, an error is returned. This operation is limited to 64-bit signed integers.

See INCR for extra information on increment/decrement operations.

Examples

SET mykey "10" DECRBY mykey 3

RESP2/RESP3 Reply

Integer reply: the value of the key after decrementing it.
RATE THIS PAGE
Back to top ↑