1

We had an issue with some automated processing and ended up with a bunch of dupes in Mongo in a single collection. I've got 7 records where I should only have 1, but I'm not sure how to go about this 100% and looking for some guidance.

I've sorted out the query and my return records look like this: Mongo Duplicates Query

What's the best way to remove these dupes?

DogEars
  • 31
  • 8

1 Answers1

0

My first thought is that you can fetch all the data you have, loop through every item and find all other objects with its same id. If found, delete them.

EmileIB
  • 1
  • 1
  • That might work out ok. If I just delete them all I can always run the import process again. I was originally thinking of other ideas based off the results of this query. – DogEars Sep 07 '22 at 21:02