title: Remove duplicate in MongoDB
body: <p>I have a collection with the field called "contact_id".
  In my collection I have duplicate registers with this key.</p>
  
  <p>How can I remove duplicates, resulting in just one register?</p>
  
  <p>I already tried:</p>
  
  <pre><code>db.PersonDuplicate.ensureIndex({"contact_id": 1}, {unique: true, dropDups: true}) 
  </code></pre>
  
  <p>But did not work, because the function <code>dropDups</code> is no longer available in MongoDB 3.x</p>
  
  <p>I'm using 3.2</p>