ARLEN

ARLEN 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 length of an array (max index + 1).

Required arguments

key

The name of the key that holds the array.

Examples

redis> ARSET myarray 0 "a"
(integer) 1
redis> ARSET myarray 5 "b"
(integer) 1
redis> ARLEN myarray
(integer) 6
redis> ARCOUNT myarray
(integer) 2

Redis Software and Redis Cloud compatibility

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

Return information

Integer reply: The length of the array (max index + 1), or 0 if key does not exist.
RATE THIS PAGE
Back to top ↑