ZCARD

redis and sorted_set | Mar 5, 2016 • Ding Jiao

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

ZADD myzset 1 "one"
ZADD myzset 2 "two"
ZCARD myzset