SCARD

Syntax
SCARD key
Available since:
1.0.0
Time complexity:
O(1)
ACL categories:
@read, @set, @fast,

返回存储在key中的集合的基数(元素数量)。

示例

SADD myset "Hello" SADD myset "World" SCARD myset

RESP2 回复

Integer reply: the cardinality (number of elements) of the set, or 0 if the key does not exist.

RESP3 回复

Integer reply: The cardinality (number of elements) of the set, or 0 if the key does not exist.
RATE THIS PAGE
Back to top ↑