Skip to content

INCR

INCR key

INCR increments the integer at ‘key’ by one. Creates ‘key’ as 1 if absent. The command raises an error if the value is a non-integer.

Returns the new value of ‘key’ on success.

localhost:7379> SET k 43
OK
localhost:7379> INCR k
OK 44
localhost:7379> INCR k2
OK 1
localhost:7379> GET k2
OK "1"