Skip to content

DECR

Syntax

DECR key

DECR command decrements the integer at ‘key’ by one. Creates ‘key’ as -1 if absent. Errors on wrong type or non-integer string. Limited to 64-bit signed integers.

Returns the new value of ‘key’ on success.

Examples

localhost:7379> SET k 43
OK OK
localhost:7379> DECR k
OK 42