OPTIONS

$setEquals (aggregation)

$setEquals

New in version 2.6.

Takes two arrays and returns true when they contain the same elements, and false otherwise.

Important

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