Navigation
This version of the documentation is archived and no longer supported.

$addToSet (aggregation)

$addToSet

Returns an array of all the values found in the selected field among the documents in that group. Every unique value only appears once in the result set. There is no ordering guarantee for the output documents.