SISMEMBER key member

Available since 1.0.0.

Time complexity: O(1)

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

*Return value

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.

*Examples

redis> SADD myset "one"

  1. (integer) 1

redis> SISMEMBER myset "one"

  1. (integer) 1

redis> SISMEMBER myset "two"

  1. (integer) 0
redis>