w3resource

Redis Sets: SISMEMBER

SISMEMBER key member

Redis SISMEMBER command is used to return the member, which is the member of the set stored at key.

Syntax:

SISMEMBER KEY VALUE

Available since:

1.0.0.

Return Value:

Integer reply,

  • 1 if the element is a member of the set.
  • 0 if the element is not a member of the set, or if the key does not exist.

Return Value Type:

Integer

Example: Redis SISMEMBER

127.0.0.1:6379> SADD mycolor "red" "green" "blue"
(integer) 3
127.0.0.1:6379> SISMEMBER mycolor "green"
(integer) 1
127.0.0.1:6379> SISMEMBER mycolor "orange"
(integer) 0


Follow us on Facebook and Twitter for latest update.