YouTip LogoYouTip

Sets Sismember

# Redis SISMEMBER Command [!(#) Redis Sets](#) The Redis SISMEMBER command checks whether a given 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 since >= 1.0.0 ### Return value Returns 1 if the element is a member of the set. Returns 0 if the element is not a member of the set, or if the key does not exist. ### Example 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 [!(#) Redis Sets](#)
← Sets SrandmemberSets Sinterstore β†’