Skip to main content

ZRANGE

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

Arguments#

keystrrequired#

The key to get.

minfloat | strrequired#

The minimum value to include.

maxfloat | strrequired#

The maximum value to include.

"-inf" and "+inf" are also valid values for the ranges

withscoresbool#

Whether to include the scores in the response.

revbool#

Whether to reverse the order of the response.

sortby"BYSCORE" | "BYLEX"#

If bylex

offsetint#

The offset to start from.

countint#

The number of elements to return.

Response#

List[str] | List[Tuple[str, float]]

The values in the specified range.

If withscores is true, the members will be tuples of the form (member, score).

Was this page helpful?