Learn R Programming

rredis (version 1.6.9)

redisIncr: Increment a value by one.

Description

Increment the value corresponding to the specified key by one.

Usage

redisIncr(key)

Arguments

key
A key corresponding to the value to increment.

Value

  • The new value of key after the increment, returned as an integer.

Details

The value should be a character representation of an integer. If the key does not exist or contains a value of a wrong type, set the key to the value of "0" before to perform the operation.

References

http://redis.io/commands

See Also

redisDecr

Examples

Run this code
redisSet('x','5')
redisIncr('x')

Run the code above in your browser using DataLab