Learn R Programming

rredis (version 1.6.9)

redisHIncrBy: Increment a value.

Description

Increment the value corresponding to the given key/field combination by the specified value.

Usage

redisHIncrBy(key, field, value, ...)

Arguments

key
A key name.
field
A field name.
value
The value to increment by (integer, numeric, or character).
...
Optional additional arguments. Specify raw=TRUE to skip de-serialization of the data.

Value

  • The new value of key after the increment, returned as a character string.

Details

The value should be an integer (redisHIncrBy) or a numeric value (redisHIncrByFloat). If the key/field value 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

redisHSet

Examples

Run this code
redisHSet('A','x',5)
redisHIncrBy('A','x',3)

Run the code above in your browser using DataLab