redisZRange: redisZRange

Description Usage Arguments Details Value Author(s) References

View source: R/zsetVal.R

Description

Return a subset of an ordered set.

Usage

1
2
redisZRange(key, start = 0, end = -1, decreasing = FALSE,
            withscores = FALSE, ...)

Arguments

key

The set name.

start

Starting index value.

end

Ending index value.

decreasing

Set TRUE to sort in decreasing order of scores.

withscores

If TRUE, also return set element scores.

...

Optional additional arguments. Specify raw=TRUE to skip de-serialization of the data.

Details

Return the specified elements of the sorted set at the specified key. The elements are considered sorted from the lowerest to the highest score if decreasing = FALSE, and from highest to lowest score if decreasing = TRUE. Start and end are zero-based indexes. 0 is the first element of the sorted set (the one with the lowerest score), 1 the next element by score and so on. start and end can also be negative numbers indicating offsets from the end of the sorted set. For example -1 is the last element of the sorted set, -2 the penultimate element and so on.

Indexes out of range will not produce an error: if start is over the end of the sorted set, or start is greater than end, an empty list is returned. If end is over the end of the sorted set Redis will threat it just like the last element of the sorted set.

Value

A list of returned set elements. If withscores = TRUE, two lists called 'elements' and 'scores' are returned.

Author(s)

B. W. Lewis

References

http://redis.io/commands


rredis documentation built on May 2, 2019, 2:02 p.m.