content/commands/zcard.md
Returns the sorted set cardinality (number of elements) of the sorted set stored
at key.
{{% redis-cli %}} ZADD myzset 1 "one" ZADD myzset 2 "two" ZCARD myzset {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="zcard-return-info" tab1="RESP2" tab2="RESP3" >}}
Integer reply: the cardinality (number of members) of the sorted set, or 0 if the key doesn't exist.
-tab-sep-
Integer reply: the cardinality (number of members) of the sorted set, or 0 if the key doesn't exist.
{{< /multitabs >}}