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