MongoDB Query Language (MQL) Set Expression Operators
$allElementsTrue
Returns true if all elements in an array are true, treating null, undefined, and missing values as false. Empty arrays return true.
$anyElementTrue
Returns true if any element in an array is true, treating null, undefined, and missing values as false. Empty arrays return false.
$setDifference
Returns an array containing elements that exist in the first set but not in the second set, performing set subtraction operation.
$setEquals
Returns true if two arrays contain the same distinct elements, regardless of order or duplicates, performing set equality comparison.
$setIntersection
Returns an array containing elements that exist in all input arrays, performing set intersection operation to find common elements.
$setIsSubset
Returns true if all elements of the first array are contained in the second array, performing subset validation regardless of element order.
$setUnion
Returns an array containing all distinct elements from the input arrays, performing set union operation to combine arrays without duplicates.