Redis Client

Download 1
Last updated Nov 18, 2026

redis-lrange

Get the elements of a Redis list in the given range, one row per element.

Syntax

redis-lrange profile=STRING key=STRING [start=INT] [stop=INT]

Options

profile=STRING
Required. Name of the Redis connect profile. Either a Redis Client (Standalone) or a Redis Client (Sentinel) profile is accepted. Example: profile=my_redis
key=STRING
Required. Redis list key to LRANGE. Example: key=queue:jobs
start=INT
Optional. Start index. Negative values count from the end. (Default: 0)
stop=INT
Optional. Stop index, inclusive. (Default: -1, the last element)

Output fields

FieldTypeNameDescription
keyStringKeyRedis list key
indexIntegerIndexZero-based position within the returned range
valueStringValueList element
_errorStringErrorError message for command failure. Absent on success

Error codes

Parse errors

Error messageCauseResolution
No available Redis profileNo profile with the given name exists, or the current account is not granted access to it.Check the profile name and grant the account access to the profile.
profile option is requiredThe profile option is missing or empty.Specify profile=profile_name.
key option is requiredThe key option is missing or empty.Specify key=key_name.
start and stop options must be integersThe start or stop value is not an integer.Specify integers, e.g. start=0 stop=9

Runtime errors

Error messageCauseResolution
(_error field of the output row)A Redis error occurred, such as a connection failure, authentication failure, timeout or WRONGTYPE. The query does not abort; one row holding only key and _error is returned.Check the message in the _error field, the connection settings and the key type.

Description

Reads list elements with the Redis LRANGE command and outputs one row per element. index is the position within the returned range, not within the whole list, so it starts at 0 even if start is specified. It takes no pipe input.

If the list key does not exist or the range holds no elements, no rows are output. A key of a non-list type outputs a WRONGTYPE error in the _error field. All elements in the range are fetched at once, so limit very large lists with start and stop.

Examples

Example: Reading the first 10 items of a job queue

Situation: Check the first 10 elements of the list queue:jobs.

redis-lrange profile=my_redis key=queue:jobs start=0 stop=9

Expected result:

keyindexvalue
queue:jobs0job-1003
queue:jobs1job-1002

Interpretation: Elements added with LPUSH are stacked at the head, so index 0 is the most recently pushed value.