Method Signature
Parameters
The key of the sorted set
The minimum range value:
- By index: 0-based index (use negative for reverse indexing, e.g., -1 for last element)
- By score: number,
(number(exclusive),-inf, or+inf - By lex:
[member(inclusive),(member(exclusive),-(minimum), or+(maximum)
The maximum range value (same format as min)
Options to control the range query behavior
ZRangeCommandOptions
Query by score range instead of index. Mutually exclusive with
byLex.Query by lexicographical range instead of index. All members must have the same score. Mutually exclusive with
byScore.Reverse the ordering, so elements are returned from highest to lowest score
Return scores along with members. The result will be a flat array alternating between members and scores.
Skip this many elements before returning results. Must be used together with
count.Return at most this many elements. Must be used together with
offset.Response
An array of members in the specified range.When
withScores is true, returns a flat array alternating between member and score: [member1, score1, member2, score2, ...]