Returns the set cardinality (number of elements) of the set stored at key
.
返回值
Integer reply: the cardinality (number of elements) of the set, or 0
if key
does not exist.
例子
redis>
SADD myset "Hello"
(integer) 1redis> SADD myset "World"
(integer) 1redis> SCARD myset
(integer) 2