Redis Sismember Command
The Redis Sismember command determines whether a member element is a member of a set.
Syntax
The basic syntax of the Redis Sismember command is as follows:
redis 127.0.0.1:6379> SISMEMBER KEY VALUE
Available Versions
>= 1.0.0
Return Value
Returns 1 if the member element is a member of the set. Returns 0 if the member element is not a member of the set, or if the key does not exist.
Examples
redis 127.0.0.1:6379> SADD myset1 "hello" (integer) 1 redis 127.0.0.1:6379> SISMEMBER myset1 "hello" (integer) 1 redis 127.0.0.1:6379> SISMEMBER myset1 "world" (integer) 0
Other Extensions
Redis Sets