content/commands/smembers.md
Returns all the members of the set value stored at key.
This has the same effect as running [SINTER]({{< relref "/commands/sinter" >}}) with one argument key.
{{< clients-example set="cmds_set" step="smembers" description="Foundational: Retrieve all members of a set using SMEMBERS (returns unordered collection, useful for iterating all set members)" difficulty="beginner" >}} redis> SADD myset "Hello" (integer) 1 redis> SADD myset "World" (integer) 1 redis> SMEMBERS myset
Give these commands a try in the interactive console:
{{% redis-cli %}} SADD myset "Hello" SADD myset "World" SMEMBERS myset {{% /redis-cli %}}
| 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> | |
{{< multitabs id="smembers-return-info" tab1="RESP2" tab2="RESP3" >}}
Array reply: an array with all the members of the set.
-tab-sep-
Set reply: a set with all the members of the set.
{{< /multitabs >}}