In MongoDB, the $setEquals aggregation pipeline operator compares two or more arrays and returns true if they have the same distinct elements and false otherwise.
$setEquals accepts two or more arguments, all of which can be any valid expression as long as they each resolve to an array. $setEquals treats the arrays as sets.