Redis Set SMEMBERS Command
The Redis SMEMBERS
command returns all the members of a set. If the set does not exist, it is treated as an empty set.
Syntax
The basic syntax of the SMEMBERS
command is as follows:
1 | SMEMBERS key |
This command returns all the members of the set value stored at key. It has the same effect as running SINTER with one argument key.
Available Since
Redis version >= 1.0.0
Time Complexity
O(N) where N is the set cardinality.
ACL Categories
@read
, @set
, @slow
Return Value
Returns a set with all the members of the set.
Example
1 | 127.0.0.1:6379> SADD key1 a b c d |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.