Skip to main content

ZRANGE

Returns the specified range of elements in the sorted set stored at key.
1 min read

Arguments#

keystringrequired#

The key to get.

minnumber | stringrequired#

The lower bound of the range.

maxnumber | stringrequired#

The upper bound of the range.

options#
Show properties
withScoresboolean#

Whether to include the scores in the response.

revboolean#

Whether to reverse the order of the response.

byScoreboolean#

Whether to use the score as the sort order.

byLexboolean#

Whether to use lexicographical ordering.

offsetnumber#

The offset to start from.

countnumber#

The number of elements to return.

Response#

TMember[]

The values in the specified range.

If withScores is true, the response will have interleaved members and scores: [TMember, number, TMember, number, ...]

Was this page helpful?