SCARD
SCARD
Syntax
SCARD key
- Available since:
- 1.0.0
- Time complexity:
- O(1)
- ACL categories:
-
@read,@set,@fast,
Returns the set cardinality (number of elements) of the set stored at key.
Return
Integer reply: the cardinality (number of elements) of the set, or 0 if key does not exist.
Examples
SADD myset "Hello" SADD myset "World" SCARD myset
© 2006–2022 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/scard/