smembers.3valkey - Man Page

Returns all members of a set.

Synopsis

SMEMBERS key

Description

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

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

Reply

Resp2

valkey-protocol(7) Array reply: all members of the set.

Resp3

valkey-protocol(7) Set reply: all members of the set.

Complexity

O(N) where N is the set cardinality.

Acl Categories

@read @set @slow

History

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"

See Also

sadd(3valkey), scard(3valkey), sdiff(3valkey), sdiffstore(3valkey), sinter(3valkey), sintercard(3valkey), sinterstore(3valkey), sismember(3valkey), smismember(3valkey), smove(3valkey), spop(3valkey), srandmember(3valkey), srem(3valkey), sscan(3valkey), sunion(3valkey), sunionstore(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual