ARGETRANGE

ARGETRANGE key start end
Available since:
Redis Open Source 8.8.0
Time complexity:
O(N) where N is the range length
ACL categories:
@read, @array, @slow,
Compatibility:
Redis Software and Redis Cloud compatibility

Gets values in a range of indices.

Required arguments

key

The name of the key that holds the array.

start

The zero-based integer index of the first element to return. If start is greater than end, elements are returned in reverse index order.

end

The zero-based integer index of the last element to return (inclusive). If end is less than start, elements are returned in reverse index order.

Examples

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
❌ Standard
❌ Active-Active
❌ Standard
❌ Active-Active

Return information