Answers for "MongoDB - Unwind array using aggregation and remove duplicates"

0

MongoDB - Unwind array using aggregation and remove duplicates

## MongoDB - Unwind array using aggregation and remove duplicates
db.users.aggregate([
  { $unwind: '$data' },
  { $group: { _id: '$_id', data: { $addToSet: '$data' } } }
]);
Posted by: Guest on September-29-2020

Code answers related to "MongoDB - Unwind array using aggregation and remove duplicates"

Browse Popular Code Answers by Language