ZCARD

ZCARD

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.

Examples #

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

Redict logo courtesy of @janWilejan, CC-BY-SA-4.0. Download SVG ⤑

Portions of this website courtesy of Salvatore Sanfilippo, CC-BY-SA-4.0.