# Contains neither test

Learn how to check if a collection has no intersection with another.

This test checks whether one collection does not contain any of the elements of another. It is the opposite of the [`contains either`](/reference/cql/expressions/tests/collection/contains-either) test.

This operation corresponds to the mathematical concept of [intersection](https://en.wikipedia.org/wiki/Intersection_\(set_theory\)) and [disjoint sets](https://en.wikipedia.org/wiki/Disjoint_sets). Specifically, it checks whether the intersection of the collection 𝐴 and 𝐵 is empty (𝐴 ∩ 𝐵 = ∅) or, equivalently, whether 𝐴 and 𝐵 are disjoint (𝐴 ∩ 𝐵 = ∅).

Note that the result is always true if the second collection is empty because the [empty set is disjoint from every set](https://en.wikipedia.org/wiki/Empty_set#properties). This is different from the [`contains none`](/reference/cql/expressions/tests/collection/contains-none) test, which returns false in this case, as it operates on the idea of subset rather than intersection.

Also, keep in mind that neither the order nor duplicate elements affect the result since collections are treated as [sets](/reference/cql/data-types/core/collection#set).

### Syntax \[#contains-neither-syntax]

This test has the following syntax:

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

Alternatively, you can use the following syntax:

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

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 neither /*<collection>*/
```

The same applies to the alternative syntax:

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

However, consider using the [`contains either`](/reference/cql/expressions/tests/collection/contains-either) test instead of negating, as it is more expressive and easier to understand.

### Parameters \[#contains-neither-parameters]

These are the supported parameters:

- `collection`: `collection`

  The collection to check.

- `subset`: `collection`

  The collection whose elements must not be contained in the other collection.

### Examples \[#contains-neither-examples]

Here is an example of a collection that does not contain any of the elements of another collection:

```cql
["a", "b", "c"] contains neither ["d", "e", "f"] // true
```

And here is a counterexample:

```cql
["a", "b", "c"] contains neither ["a", "d", "e"] // false
```

To negate the test, you can write:

```cql
["a", "b", "c"] does not contain neither ["d", "e", "f"] // false
```

If the second collection is empty, the result is always `true`:

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