Redis - Set Smembers Command



Redis SMEMBERS returns, all the elements exists in set stored at specified key.

Return Value

Array reply, all elements of the set.

Syntax

Basic syntax of redis SMEMBERS command is shown below:

redis 127.0.0.1:6379> SMEMBERS KEY VALUE 

Example

redis 127.0.0.1:6379> SADD myset1 "hello"
(integer) 1
redis 127.0.0.1:6379> SADD myset1 "world"
(integer) 1
redis 127.0.0.1:6379> SMEMBERS myset1
1) "World"
2) "Hello"
Advertisements