Several commands allow you to work with Strings representing integer values.
A user can set the integer value of a key using the command:
SET intkey 2
The set command will create the key if necessary or update it if it already exists.
The value of an integer key can be updated on the server using either the INCR or INCRBY commands. INCR will increase the value of a key by 1 and INCRBY will increase the value of the key by the provided step value.
INCR intkey
INCRBY intkey 2
If the value of the key specified to INCR or INCRBY can't be expressed as an integer, Redis will return an error. If the key doesn't exist, the key will be created and the operation will be applied to the default value of 0.
The DECR and DECRBY ccommands work in reverse to decrement the value.