What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

SMEMBERS

Returns all members of a set.

Usage
SMEMBERS key
Complexity
O(N) where N is the set cardinality.
Since
1.0.0
ACL Categories
@read, @set, @slow
Command flags
READONLY

Returns all the members of the set value stored at key.

This has the same effect as running SINTER with one argument key.

Examples

127.0.0.1:6379> SADD myset "Hello"
(integer) 1
127.0.0.1:6379> SADD myset "World"
(integer) 1
127.0.0.1:6379> SMEMBERS myset
1) "Hello"
2) "World"

Replies

RESP2

Array reply: all members of the set.

RESP3

Set reply: all members of the set.