IncrCommand
#sidebar
StringCommandsSidebar
Time complexity: O(1)Increment or decrement the number stored at key by one. If the key doesnot exist or contains a value of a wrong type, set the key to thevalue of "0" before to perform the increment or decrement operation.
INCRBY and DECRBY work just like INCR and DECR but instead toincrement/decrement by 1 the increment/decrement is integer.
INCR commands are limited to 64 bit signed integers.
Integer reply, this commands will reply with the new value of
key after the increment or decrement.