Containing neither
Learn how to check if a collection has no intersection with another.
This operator checks whether one collection does not contain any of the elements of another. It is the opposite of the containing either test.
Note that the result is always true if the second collection is empty because the empty set is disjoint from every set. This is different from the containing 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.
You can combine conditions to create more advanced criteria.
Syntax
The basic syntax is:
with /*<property>*/ containing neither /*<collection>*/
Alternatively, you can use the including keyword:
with /*<property>*/ including neither /*<collection>*/
The negation of this operation can be expressed as:
with /*<property>*/ not containing neither /*<collection>*/
Using the alternative syntax:
with /*<property>*/ not including neither /*<collection>*/
Parameters
These are the supported parameters:
- name
The name of the event property to search for in the collection.
- collection
The collection to check.
Examples
Check if a post with none of the specified tags was viewed:
user has viewed post with tags containing neither ["news", "cases"]
Or to check the opposite:
user has viewed post with tags not containing neither ["news", "cases"]