title: MongoDB query to remove duplicate documents from a collection
body: <p>I take data from a search box and then insert into MongoDB as a document using the regular insert query. The data is stored in a collection for the word "cancer" in the following format with unique "_id".</p>
  
  <pre><code>{
    "_id": {
      "$oid": "553862fa49aa20a608ee2b7b"
    },
    "0": "c",
    "1": "a",
    "2": "n",
    "3": "c",
    "4": "e",
    "5": "r"
  }
  </code></pre>
  
  <p>Each document has a single word stored in the same format as above. I have many documents as such. Now, I want to remove the duplicate documents from the collection. I am unable to figure out a way to do that. Help me.</p>