Learn R Programming

rredis (version 1.7.0)

redisLPush: Add a value to the head tail of a list.

Description

Add values to the tail (LPush) or head (RPush) of a list corresponding to the specified key.

Usage

redisLPush(key, value, ...)

Arguments

key
The desired key corresponding to a list.
value
The element to add to the list.
...
Optional additional values to add to the list.

Value

The length of the list after the push operation.

Details

If the key does not exist an empty list is created just before the append operation. If the key exists but is not a list an error is returned.

References

http://redis.io/commands

See Also

redisRPush

Examples

Run this code
## Not run: 
# redisConnect()
# redisLPush('x',1)
# redisLPush('x',2)
# redisLPush('x',3)
# redisRPush('x',11)
# redisRPush('x',21)
# redisRPush('x',31)
# redisLLen('x')
# ## End(Not run)

Run the code above in your browser using DataLab