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

redisLTrim

Trim a list.


Description

Trim an existing list so that it will contain only the specified range of elements specified.

Usage

redisLTrim(key, start, end)

Arguments

key

A key corresponding to a Redis list object.

start

The starting list index at which to trim.

end

The ending list index at which to trim.

Details

Start and end are zero-based indexes. 0 is the first element of the list (the list head), 1 the next element and so on.

Value

TRUE if successful. An error is thrown if the key does not exist or correspond to a list value.

Author(s)

B. W. Lewis

References

http://redis.io/commands

See Also

Examples

## Not run: 
redisConnect()
redisLPush('x',1)
redisLPush('x',2)
redisLPush('x',3)
redisLTrim('x',0,1)
redisLRange('x',0,99)

## 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.