$unwind
32/62
Collecting Distinct Values
Yielding Multiple Documents from One
•
Operate on an array field
•
Yield new documents for each array element
•
Array replaced by element value
•
Missing/empty fields → no output
•
Non-array fields → error
•
Pipe to
$group
to aggregate array values