OPTIONS

$setIntersection (aggregation)

$setIntersection

New in version 2.6.

Takes any number of arrays and returns an array that contains the elements that appear in every input array.

Important

$setIntersection takes arrays as arguments and treats these arrays as sets. $setIntersection ignores duplicate entries in input arrays and produce arrays that contain unique entries.