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.

SMISMEMBER

Last updated
SMISMEMBER key member [member ...]
Group
Set
Complexity
O(N) where N is the number of members checked
Arity
-3 (at least 3 words, counting the command name)
Flags
read-only, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

SMISMEMBER checks each member against the set stored at key and returns one result per member, in the order given. A missing key behaves like an empty set.

Case RESP2 RESP3
Success Array of integers: 1 for a member, 0 otherwise Same

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

127.0.0.1:6379> SADD tags "redis" "cache"
(integer) 2
127.0.0.1:6379> SMISMEMBER tags "redis" "mysql" "cache"
1) (integer) 1
2) (integer) 0
3) (integer) 1

Same as Redis 7.4 and Valkey 8.

SISMEMBER, SMEMBERS, SINTERCARD