Redis sismember 命令

SISMEMBER key member

Returns if member is a member of the set stored at key.

*返回值

Integer reply, specifically:

  • 1 if the element is a member of the set.
  • 0 if the element is not a member of the set, or if key does not exist.

*实例

redis>  SADD myset “one”

(integer) 1

redis>  SISMEMBER myset “one”

(integer) 1

redis>  SISMEMBER myset “two”

(integer) 0

redis>