Redis Sets: SCARD key
SCARD key
Redis SCARD command is used to return the number of elements stored in the set.
Syntax:
SCARD KEY_NAME
Available since
1.0.0.
Return Value:
Integer replies the cardinality (number of elements) of the set, or 0 if the key does not exist.
Return Value Type:
Integer
Example: Redis SCARD
127.0.0.1:6379> SADD mycolor "Red" "Green" (integer) 2 127.0.0.1:6379> SADD mycolor "Blue" "Yellow" (integer) 2 127.0.0.1:6379> SCARD mycolor (integer) 4
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics