Redis Sorted Sets: ZCARD
ZCARD key
Redis ZCARD command is used to return the number of elements stored in the set at specified key.
Syntax:
ZCARD KEY_NAME
Available since
1.2.0.
Return Value
Integer replies the cardinality (number of elements) of the sorted set, or 0 if the key does not exist.
Return Value Type
Integer
Example: Redis ZCARD
127.0.0.1:6379> ZADD mycolorset 10 white 12 black 14 red 16 blue (integer) 4 127.0.0.1:6379> ZADD mycolorset 18 green 20 orange 22 pink 24 yellow (integer) 4 127.0.0.1:6379> ZCARD mycolorset (integer) 8 127.0.0.1:6379>
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework