ARCOUNT

ARCOUNT key
Available since:
Redis Open Source 8.8.0
Time complexity:
O(1)
ACL categories:
@array,

Returns the number of non-empty elements in an array.

Required arguments

key

The name of the key that holds the array.

Examples

ARSET myarray 0 "a" ARSET myarray 5 "b" ARCOUNT myarray

Return information

Integer reply: The number of non-empty elements, or 0 if key does not exist.
RATE THIS PAGE
Back to top ↑