Skip to content

INCR

Syntax

INCR key

INCR command increments 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> INCR k
OK 44