# In

Learn how to check if an element exists in a collection.

This operator checks whether an element is in a collection. It works the same way as the [`containing`](/reference/cql/expressions/events/criteria/operators/containing) operator, but in the opposite direction.

When comparing elements, this operator uses the same [equivalence rules](/reference/cql/expressions/operations/comparison/overview#equivalence) as the [`equal to`](/reference/cql/expressions/events/criteria/operators/equal-to) operation.

> **Multi-condition criteria**
>
> You can [combine conditions](/reference/cql/expressions/events/criteria/overview#multi-condition-criteria) to create more advanced criteria.

## Syntax

The basic syntax is:

```cql
with /*<name>*/ in /*<collection>*/
```

The negation of this operation can be expressed as:

```cql
with /*<name>*/ not in /*<collection>*/
```

## Parameters

These are the supported parameters:

- `name`: `any`

  The name of the [event property](/reference/cql/expressions/events/event-types) to search for in the collection.

- `collection`: `collection`

  The collection to check.

## Examples

Check if a post with a specific tag was viewed:

```cql
user has viewed post with "news" in tags
```

Or to check the opposite:

```cql
user has viewed post with "news" not in tags
```
