# Contains none test

Learn how to check if a collection has no elements in common with another.

This test checks whether one collection contains none of the elements of another. It is the opposite of the [`contains all`](/reference/cql/expressions/tests/collection/contains-all) test.

This operation corresponds to the mathematical concepts of [superset](https://en.wikipedia.org/wiki/Subset#superset) and [subset](https://en.wikipedia.org/wiki/Subset#subset). Specifically, it checks whether the collection 𝐴 is not a superset of 𝐵 (𝐴 ⊉ 𝐵) or, conversely, whether 𝐵 is not a subset of 𝐴 (𝐵 ⊈ 𝐴).

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

> **Are none of the unicorns in the room shining?**
>
> Technically, yes. Since there are no unicorns in the room, there's no unicorn that isn't shining. Logic is fun, isn't it?

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-none-syntax]

This test has the following syntax:

```cql
/*<collection>*/ contains none of /*<collection>*/
```

Alternatively, you can use the following syntax:

```cql
/*<collection>*/ includes none of /*<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 none of /*<collection>*/
```

The same applies to the alternative syntax:

```cql
/*<collection>*/ does not include none of /*<collection>*/
```

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

## Parameters \[#contains-none-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-none-examples]

Here is an example of a collection that contains none of the elements of another collection:

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

And here is a counterexample:

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

To negate the test, you can write:

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

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

```cql
["a", "b", "c"] contains none of [] // false
```
