Strings Decrby
# Redis Decrby Command
[!(#) Redis Strings](#)
The Redis Decrby command decrements the value stored at key by the specified decrement.
If the key does not exist, it is initialized to 0 before performing the DECRBY operation.
If the value contains the wrong type or the string value cannot be represented as a number, an error is returned.
The value is limited to 64-bit signed integer representation.
### Syntax
The basic syntax of Redis Decrby command is:
redis 127.0.0.1:6379> DECRBY KEY_NAME DECREMENT_AMOUNT
### Available Version
>= 1.0.0
### Return Value
The value of key after the decrement.
### Examples
# DECRBY on an existing key redis> SET count 100 OK redis> DECRBY count 20(integer) 80# DECRBY on a non-existent key redis> EXISTS pages (integer) 0 redis> DECRBY pages 10(integer) -10
[!(#) Redis Strings](#)
YouTip