ZCARD
Syntax
ZCARD key
- Available since:
- Redis Open Source 1.2.0
- Time complexity:
- O(1)
- ACL categories:
-
@read,@sortedset,@fast, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
Returns the sorted set cardinality (number of elements) of the sorted set stored
at key.
Examples
Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
Integer reply: the cardinality (number of members) of the sorted set, or 0 if the key doesn't exist.