Learn R Programming

rredis (version 1.6.9)

redisDecrBy: Decrement a value by the specified value.

Description

Decrement the value corresponding to the specified key.

Usage

redisDecrBy(key, value)

Arguments

key
A key corresponding to the value to decrement.
value
The value to decrement by (integer, numeric, or character).

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')
redisDecrBy('x','3')

Run the code above in your browser using DataLab