SISMEMBER
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.
Return value
Section titled “Return value”| 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.
Examples
Section titled “Examples”127.0.0.1:6379> SADD tags "redis"(integer) 1127.0.0.1:6379> SISMEMBER tags "redis"(integer) 1127.0.0.1:6379> SISMEMBER tags "mysql"(integer) 0Compatibility
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.