Actions37
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Keys
- Hash Length
- Hash Values
- Increment
- Info
- JSON Get
- JSON Set
- Keys
- List Length
- Multi Get
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Remove
- Sorted Set Add
- Sorted Set Cardinality
- Sorted Set Range
- Sorted Set Remove
- String Length
- TTL
Sorted Set Range
AI-generatedSummary
Retrieve a range of members from a Redis sorted set with optional inclusion of their scores.
Inputs
- Sorted Set (required) — The name of the sorted set from which to retrieve members.
- Start — The start index for the range (inclusive). Defaults to 0.
- Stop — The stop index for the range (inclusive). Use -1 to indicate the end of the sorted set. Defaults to -1.
- With Scores — Whether to include the members' scores in the returned result. Defaults to false.
Output shape
A list of JSON objects, each containing the retrieved members. If 'With Scores' is enabled, each entry includes the member along with its score; otherwise, only members are returned.
The range uses zero-based inclusive indices. Negative indices are supported to specify offsets from the end (-1 corresponds to the last element). Returned data structure depends on the 'With Scores' parameter.
Examples
Example 1: Retrieve all members from a sorted set named 'leaderboard' with their scores.
Set 'Sorted Set' to 'leaderboard', 'Start' to 0, 'Stop' to -1, and 'With Scores' to true.