SMISMEMBER
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.
Return value
Section titled “Return value”| 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.
Examples
Section titled “Examples”127.0.0.1:6379> SADD tags "redis" "cache"(integer) 2127.0.0.1:6379> SMISMEMBER tags "redis" "mysql" "cache"1) (integer) 12) (integer) 03) (integer) 1Compatibility
Section titled “Compatibility”Same as Redis 7.4 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.