What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

SISMEMBER

Determines whether a member belongs to a set.

Usage
SISMEMBER key member
Complexity
O(1)
Since
1.0.0
ACL Categories
@fast, @read, @set
Command flags
READONLY, FAST

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

Examples

127.0.0.1:6379> SADD myset "one"
(integer) 1
127.0.0.1:6379> SISMEMBER myset "one"
(integer) 1
127.0.0.1:6379> SISMEMBER myset "two"
(integer) 0

Replies

RESP2

One of the following:

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

RESP3

One of the following:

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