In MongoDB, the $setIntersection
aggregation pipeline operator accepts two or more arrays and returns an array that contains the elements that appear in all input arrays.
$setIntersection
accepts two or more arguments, all of which can be any valid expression as long as they each resolve to an array. $setIntersection
treats the arrays as sets.