# SINTER

> Return the members present in every one of the given sets.

URL: https://docs.hotkv.com/commands/sinter/

```
SINTER key [key ...]
```

- Group: Set
- Complexity: O(N*M) worst case, where N is the size of the smallest set and M is the number of sets
- HotKV Cloud: all plans
- On-Premise: no license needed

`SINTER` returns the intersection of the given sets: the members that are in
all of them. A missing key counts as an empty set, so if any key is missing
the result is empty. To count the intersection without returning it, use
[SINTERCARD](https://docs.hotkv.com/commands/sintercard/index.md); to store it, use
[SINTERSTORE](https://docs.hotkv.com/commands/sinterstore/index.md).

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Success | Array of bulk strings (empty if there is no common member) | Set of bulk strings |

`SINTER` replies with a `WRONGTYPE` error if any of the keys holds a value that
is not a set, even when another key is missing.

## Examples

```
127.0.0.1:6379> SADD a "x" "y" "z"
(integer) 3
127.0.0.1:6379> SADD b "y" "z" "w"
(integer) 3
127.0.0.1:6379> SINTER a b
1) "y"
2) "z"
127.0.0.1:6379> SINTER a nosuchkey
(empty array)
```

## Compatibility

Same as Redis 7.4 and Valkey 8.

## See also

[SINTERSTORE](https://docs.hotkv.com/commands/sinterstore/index.md), [SINTERCARD](https://docs.hotkv.com/commands/sintercard/index.md), [SUNION](https://docs.hotkv.com/commands/sunion/index.md),
[SDIFF](https://docs.hotkv.com/commands/sdiff/index.md), [ZINTER](https://docs.hotkv.com/commands/zinter/index.md)