Duva - Distributed Cache Server

DECR

Decrease value for the key when it is parsable to integer

Syntax

DECR key

Decrements the integer value stored at key by 1. If the key doesn’t exist, it is initialized to 0 before performing the operation. The value must be parsable as an integer or an error will be returned.

Example

duva-cli> SET key "3"
"OK"
duva-cli> DECR key
(integer) 2
duva-cli> SET key "334293482390480948029348230948"
"OK"
duva-cli> DECR mykey
(error) ERR value is not an integer or out of range 

Return value: Integer reply - the value after incrementation

Notes