Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

redisLRem

Remove elements from a list.


Description

Remove the fist count occurences of the given value from a list corresponding to the specified key.

Usage

redisLRem(key, count, value)

Arguments

key

The desired key corresponding to a list.

count

The maximum number of occurences to remove.

value

Remove elements matching this value from the list.

Details

Remove the first count occurrences of the value element from the list. If count is zero all the elements are removed. If count is negative elements are removed from tail to head, instead of the default removal behavior from head to tail. So for example redisLRem with count -2 and value "hello" applied to the list (a,b,c,hello,x,hello,hello) will yield the list (a,b,c,hello,x). The number of removed elements is returned as an integer upon success. Note that non-existing keys are considered as empty lists.

Value

The number of occurrences removed.

Author(s)

B. W. Lewis

References

http://redis.io/commands

See Also

Examples

## Not run: 
redisConnect()

## End(Not run)

rredis

"Redis" Key/Value Database Client

v1.7.0
Apache License (>= 2.0)
Authors
B. W. Lewis
Initial release
2015-07-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.