Learn R Programming

rredis (version 1.6.9)

redisDecr: Decrement a value by one.

Description

Decrement the value corresponding to the specified key by one.

Usage

redisDecr(key)

Arguments

key
A key corresponding to the value to decrement.

Value

  • The new value of key after the decrement, 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

redisIncr

Examples

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

Run the code above in your browser using DataLab