ARSEEK

ARSEEK key index
Available since:
Redis Open Source 8.8.0
Time complexity:
O(1)
ACL categories:
@write, @array, @fast,
Compatibility:
Redis Software and Redis Cloud compatibility

Sets the ARINSERT / ARRING cursor to a specific index.

Required arguments

key

The name of the key that holds the array.

index

The zero-based integer index to set as the new insert cursor position for subsequent ARINSERT calls.

Examples

redis> ARINSERT myarray "a"
(integer) 0
redis> ARINSERT myarray "b"
(integer) 1
redis> ARNEXT myarray
(integer) 2
redis> ARSEEK myarray 10
(integer) 1
redis> ARINSERT myarray "c"
(integer) 10
redis> ARNEXT myarray
(integer) 11

Redis Software and Redis Cloud compatibility

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

Return information

Integer reply: 1 if the cursor was set, 0 if the key does not exist.
RATE THIS PAGE
Back to top ↑