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 operator, but in the opposite direction.

When comparing elements, this operator uses the same equivalence rules as the equal to operator.

Syntax

The basic syntax is:

with /*<name>*/ containing /*<element>*/

Alternatively, you can use the including keyword:

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

The negation of this operation can be expressed as:

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

Using the alternative syntax:

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

Parameters

These are the supported parameters:

name

The name of the event property to check.

element
any

The element to search for in the collection.

Examples

Check if a post with a specific tag was viewed:

user has viewed post with tags containing "news"
Try in Playground

Or to check the opposite:

user has viewed post with tags not containing "news"
Try in Playground