Back to Redis

SMISMEMBER

content/commands/smismember.md

latest1.2 KB
Original Source

Returns whether each member is a member of the set stored at key.

For every member, 1 is returned if the value is a member of the set, or 0 if the element is not a member of the set or if key does not exist.

Examples

{{% redis-cli %}} SADD myset "one" SADD myset "one" SMISMEMBER myset "one" "notamember" {{% /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="smismember-return-info" tab1="RESP2" tab2="RESP3" >}}

Array reply: a list representing the membership of the given elements, in the same order as they are requested.

-tab-sep-

Array reply: a list representing the membership of the given elements, in the same order as they are requested.

{{< /multitabs >}}