ARNEXT

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

Returns the next index ARINSERT would use.

Required arguments

key

The name of the key that holds the array.

Examples

redis> ARINSERT myarray "a"
(integer) 0
redis> ARINSERT myarray "b"
(integer) 1
redis> ARNEXT myarray
(integer) 2

Redis Software and Redis Cloud compatibility

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

Return information

One of the following:

  • Integer reply: The next index ARINSERT would use. Returns 0 for missing keys or when no insert happened yet.
  • Nil reply: Null when the insertion cursor is exhausted (next insert would overflow).
RATE THIS PAGE
Back to top ↑