---
title: "SMEMBERS"
url: "https://docs.yugabyte.com/stable/yedis/api/smembers/"
---

# SMEMBERS

## Synopsis

**`SMEMBERS key`**

This command selects all members of the set that is associated with the given `key`.

- If `key` is associated with a value that is not a set, an error is raised.
- If `key` does not exist, no value is returned.

## Return value

Returns all members of the given set.

## Examples

```sh
$ SADD yuga_world "Africa"
```

```
1
```

```sh
$ SADD yuga_world "America"
```

```
1
```

```sh
$ SMEMBERS yuga_world
```

```
1) "Africa"
2) "America"
```

## See also

[`sadd`](/stable/yedis/api/sadd/ "sadd"), [`scard`](/stable/yedis/api/scard/ "scard"), [`sismember`](/stable/yedis/api/sismember/ "sismember"), [`srem`](/stable/yedis/api/srem/ "srem")
