title: dropDups true not working mongodb
body: <p>I am using <code>mongoDB shell with version 3.0.2</code>
  I am trying to ensure uniqueness constraint over a <code>username</code> field in collection <code>users</code>. </p>
  
  <p>This is what I gave:</p>
  
  <pre><code>db.users.ensureIndex({"username": 1},{unique: true})
  </code></pre>
  
  <p>It gave me following error:</p>
  
  <pre><code>{
      "createdCollectionAutomatically" : false,
      "numIndexesBefore" : 1,
      "errmsg" : "exception: E11000 duplicate key error index: mybackend.users.$username_1 dup key: { : \"rahat\" }",
      "code" : 11000,
      "ok" : 0
  }
  </code></pre>
  
  <p>Then i used, <code>dropDups: true</code> in the command:</p>
  
  <pre><code> db.users.ensureIndex({"username": 1},{unique: true, dropDups: true})
  </code></pre>
  
  <p>Then too I get the same error:</p>
  
  <pre><code> {
      "createdCollectionAutomatically" : false,
      "numIndexesBefore" : 1,
      "errmsg" : "exception: E11000 duplicate key error index: mybackend.users.$username_1 dup key: { : \"rahat\" }",
      "code" : 11000,
      "ok" : 0
  }
  </code></pre>
  
  <p>I also saw <a href="https://stackoverflow.com/questions/8943418/ensure-index-not-working-mongodb">this SO link</a> but here it already had one index. Mine does not have one. </p>
  
  <p><code>db.users.getIndexes()</code> -></p>
  
  <pre><code>[
      {
          "v" : 1,
          "key" : {
              "_id" : 1
          },
          "name" : "_id_",
          "ns" : "mybackend.users"
      }
  ]
  </code></pre>
  
  <p>I looked for <a href="https://github.com/Automattic/mongoose/issues/56" rel="noreferrer">this issue on github</a> and restarted the mongo but to no use. What am I doing wrong? I think I am doing a silly mistake. Please help. </p>