# Contains test

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

This test checks whether a collection contains a certain element. It works the same way as the [`in`](/reference/cql/expressions/tests/collection/in) test, but with the operands reversed.

You can use any collection type, including lists and maps. Keys are ignored when checking whether a map contains an element.

When comparing elements, this test uses the same [equivalence rules](/reference/cql/expressions/operations/comparison/overview#equivalence) as the [`equal`](/reference/cql/expressions/operations/comparison/equal) operation to ensure consistency in how it determines whether two items are equal.

## Syntax \[#contains-syntax]

This test has the following syntax:

```cql
/*<collection>*/ contains /*<element>*/
```

You can alternatively use the following syntax:

```cql
/*<collection>*/ includes /*<element>*/
```

Both forms have the same semantics. You can use whichever makes your query more expressive and easier to read.

You can negate the test to verify the contrary:

```cql
/*<collection>*/ does not contain /*<element>*/
```

The same applies to the alternative syntax:

```cql
/*<collection>*/ does not include /*<element>*/
```

## Parameters \[#contains-parameters]

These are the supported parameters:

- `collection`: `collection`

  The collection to check.

- `element`: `any`

  The element to search for in the collection.

## Examples \[#contains-examples]

Here is a simple example that checks whether a list contains a certain element:

```cql
["a", "b", "c"] contains "b" // true
```

To negate the test, you can write:

```cql
["a", "b", "c"] does not contain "b" // false
```
