# Containing

Learn how to check if a collection contains a specific element.

This operator checks whether a collection contains a certain element. It works the same way as the [`in`](/reference/cql/expressions/events/criteria/operators/in) 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) operator.

> **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>*/ containing /*<element>*/
```

Alternatively, you can use the `including` keyword:

```cql
with /*<name>*/ including /*<element>*/
```

The negation of this operation can be expressed as:

```cql
with /*<name>*/ not containing /*<element>*/
```

Using the alternative syntax:

```cql
with /*<name>*/ not including /*<element>*/
```

## Parameters

These are the supported parameters:

- `name`: `collection`

  The name of the [event property](/reference/cql/expressions/events/event-types) to check.

- `element`: `any`

  The element to search for in the collection.

## Examples

Check if a post with a specific tag was viewed:

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

Or to check the opposite:

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