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:
ARRAY,

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

ARMSET myarray 0 "a" 1 "b" 3 "d" ARGETRANGE myarray 0 3 ARGETRANGE myarray 3 0

Return information

RATE THIS PAGE
Back to top ↑