# TAG.INTER

> Return the keys that carry all of the given tags.

URL: https://docs.hotkv.com/commands/tag-inter/

```
TAG.INTER tag [tag ...]
```

- Group: Tags
- Complexity: O(n * t), n being the keys of the rarest tag and t the tags
- HotKV Cloud: all plans
- On-Premise: no license needed

`TAG.INTER` returns the keys that carry every one of the given tags. If any
tag is unused, the result is empty. The order is not defined.

As with [TAG.MEMBERS](https://docs.hotkv.com/commands/tag-members/index.md), tags are shared by all
logical databases, so a key in any database can appear. In cluster mode, the command answers from the node you send it to.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Array of key names (empty when none match) | Array of key names |

## Examples

```
127.0.0.1:6379> MSET article:1 "..." article:2 "..."
OK
127.0.0.1:6379> TAG.SET article:1 news sports
(integer) 2
127.0.0.1:6379> TAG.SET article:2 news
(integer) 1
127.0.0.1:6379> TAG.INTER news sports
1) "article:1"
127.0.0.1:6379> TAG.INTER news weather
(empty array)
```

## Compatibility

HotKV-only command.

## See also

[TAG.MEMBERS](https://docs.hotkv.com/commands/tag-members/index.md), [TAG.SET](https://docs.hotkv.com/commands/tag-set/index.md), [VSIM.SEARCH](https://docs.hotkv.com/commands/vsim-search/index.md)