SCARD
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
SCARD key
This command finds the cardinality of the set that is associated with the given key
. Cardinality is the number of elements in a set.
- If the
key
does not exist, 0 is returned. - If the
key
is associated with a non-set value, an error is raised.
Return Value
Returns the cardinality of the set.
Examples
You can do this as shown below.
$ SADD yuga_world "America"
1
$ SADD yuga_world "Asia"
1
$ SCARD yuga_world
2
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .