SISMEMBER · Valkey

SISMEMBER

Determines whether a member belongs to a set.

Usage

SISMEMBER key member

Description

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

Reply

One of the following:

Complexity

O(1)

ACL Categories

@fast @read @set

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

History

See also

SADD, SCARD, SDIFF, SDIFFSTORE, SINTER, SINTERCARD, SINTERSTORE, SMEMBERS, SMISMEMBER, SMOVE, SPOP, SRANDMEMBER, SREM, SSCAN, SUNION, SUNIONSTORE.