Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

SISMEMBER

Last updated
SISMEMBER key member
Group
Set
Complexity
O(1)
Arity
3 (exactly, counting the command name)
Flags
read-only, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

SISMEMBER tells you whether member is in the set stored at key. To check several members in one call, use SMISMEMBER.

Case RESP2 RESP3
Member of the set Integer 1 Same
Not a member, or key does not exist Integer 0 Same

SISMEMBER replies with a WRONGTYPE error if key holds a value that is not a set.

127.0.0.1:6379> SADD tags "redis"
(integer) 1
127.0.0.1:6379> SISMEMBER tags "redis"
(integer) 1
127.0.0.1:6379> SISMEMBER tags "mysql"
(integer) 0

Same as Redis 7.4 and Valkey 8.

SMISMEMBER, SMEMBERS, SADD