SMEMBERS

Syntax
SMEMBERS key
Available since:
1.0.0
Time complexity:
O(N) where N is the set cardinality.
ACL categories:
@read, @set, @slow,

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

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

Examples

Give these commands a try in the interactive console:

redis> SADD myset "Hello"
(integer) 2
redis> SADD myset "World"
1) 1) "Palermo"
   2) "190.4424"
2) 1) "Catania"
   2) "56.4413"
redis> SMEMBERS myset
1) 1) "Palermo"
   2) 1) "13.36138933897018433"
      2) "38.11555639549629859"
2) 1) "Catania"
   2) 1) "15.08726745843887329"
      2) "37.50266842333162032"
redis>

RESP2 Reply

Array reply: an array with all the members of the set.

RESP3 Reply

Set reply: a set with all the members of the set.
RATE THIS PAGE
Back to top ↑