Set Operators

Operator

Description

Example

$setEquals

Evaluates to true if the passed in array properties or expressions contain the same distinct elements

{“$setEquals”: [ {“$array”: [“cpg”, “mvc”, “kvm”]}, “c_requested” ] }}

$setIntersection

Returns the intersection between 2 or more input arrays.

{“$setIntersection”:[“c_available”, “c_reserved”][“c_available”, “c_reserved”]}

$setUnion

Combines 2 or more input arrays.

{“$setUnion”:[{“$array”: [“000000000000000000000007”]}, “roles”]}}}

$setDifference

Returns the difference between 2 or more input arrays.

{“$setDifference”:[{“$array”: [“000000000000000000000007”]}, “roles”]}}}

$setIsSubset

Returns true if the first array is a subset of the second.

{“$setIsSubset”: [“c_some”, “c_all”][“c_some”, “c_all”]}

$anyElementTrue

Returns true if any property or expression in the passed in array evaluates to true.

{“$anyElementTrue”: [“c_bool”, “c_fav”][“c_bool”, “c_fav”]}

$allElementsTrue

Returns true if all properties or expressions in the passed in array evaluate to true.

{“$allElementsTrue”: [“c_bool”, “c_fav”][“c_bool”, “c_fav”]}