Back to Redis

SISMEMBER

content/commands/sismember.md

latest1.3 KB
Original Source

Returns if member is a member of the set stored at key.

Examples

{{% redis-cli %}} SADD myset "one" SISMEMBER myset "one" SISMEMBER myset "two" {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="sismember-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

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

-tab-sep-

One of the following:

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

{{< /multitabs >}}