❔ MONGO - Aggregate pipeline - GroupBy mutliple fields
I'm trying to run duplicate detection on nested object like this:
Here's 3 object in the same collection:
Badge Duplicate detection should return, dup'
but I don't know how to
Here's 3 object in the same collection:
Badge Duplicate detection should return, dup'
Badge that have same Email ExternalId- Badge 1, 3, 6, 7 as same badge => on user 1, 2, 4 (4 twice)
- Badge 2 and 4 => for user 1 and 3
$unwind will eventually helps as it will flatMap the data on ever Badges:but I don't know how to
Group By { "Badge.Email", "Badge.ExternalId" } and associating all the user with it