Latest web development tutorials

Redis Smembers command

Redis set (Set)

Redis Smembers command returns a collection of all the members. There is no set of key is considered empty.

grammar

redis Smembers basic command syntax is as follows:

redis 127.0.0.1:6379> SMEMBERS KEY VALUE 

Available versions

> = 1.0.0

return value

All members of the collection.

Examples

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"

Redis set (Set)