English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis SMEMBERS Command

Redis Sets (Set)

The Redis SMEMBERS command returns all members in the set. A non-existent key is considered as an empty set.

Syntax

Basic Syntax of Redis SMEMBERS Command

redis 127.0.0.1:6379> SMEMBERS key

Available Version

>= 1.0.0

Return Value

All members in the set.

Online 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 Sets (Set)