Mongodb – Perform aggregation to eliminate duplicates and get unique counts
I have mongo documents like below, want to perform aggregation to find the errorcodes count for each unique contacts. { "_id": { "$oid": "" }, "campId": "61baef7817cd8ff66518", //camp1 "contactId": "61aa6fbf77490b0007714273", // contact 1 "title": "Happy Holidays!", "communicationType": "EMAIL", "contactedOnTime": {…