📅  最后修改于: 2022-03-11 14:58:40.854000             🧑  作者: Mango
## MongoDB - Unwind array using aggregation and remove duplicates
db.users.aggregate([
{ $unwind: '$data' },
{ $group: { _id: '$_id', data: { $addToSet: '$data' } } }
]);