ZCARD key
Available since: 1.2.0
Time complexity: O(1)
ACL categories:
@read
@sortedset
@fast
Returns the sorted set cardinality (number of elements) of the sorted set stored
at key
.
@return
@integer-reply: the cardinality (number of elements) of the sorted set, or 0
if key
does not exist.
@examples
redis> ZADD myzset 1 "one"
TBD
redis> ZADD myzset 2 "two"
TBD
redis> ZCARD myzset