1

I have a database which consists of few collections , i have tried copying from one collection to another . In this process connection was lost and had to recopy them now i find around 40000 records duplicates.

Format of my data:

{ 
    "_id" : ObjectId("555abaf625149715842e6788"), 
    "reviewer_name" : "Sudarshan A", 
    "emp_name" : "Wilson Erica", 
    "evaluation_id" : NumberInt(550056), 
    "teamleader_id" : NumberInt(17199), 
    "reviewer_id" : NumberInt(1659), 
    "team_manager" : "Las Vegas", 
    "teammanager_id" : NumberInt(12245), 
    "team_leader" : "Thomas Donald", 
    "emp_id" : NumberInt(7781)
}

here only evaluation id is unique.

Queries that i have tried:

ensureIndex({id:1}, {unique:true, dropDups:true})
ZeMoon
  • 20,054
  • 5
  • 57
  • 98
ravi
  • 11
  • 4

1 Answers1

0

dropDups was removed in mongodb ~2.7.

Here is other realization method

but I don't test it

Community
  • 1
  • 1
FuWensong
  • 1
  • 2
  • “While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.” – Kevin Nov 04 '15 at 03:11