title: Mongo fails to create unique _id when inserting
body: <p>I'm building a node.js app and tries to insert several documents to a collection at once but It fails with an error</p>
  
  <pre><code>E11000 duplicate key error index: mydb.mycollection.$_id_  dup key: { : ObjectId('52f0ce126bee2f405a755c6b') }
  </code></pre>
  
  <p>Here is code that gives me that error</p>
  
  <pre><code>var my_docs = new Array;
  var tmp = {'name':'','address':''};
  for (var i=0; i &lt; limit ; i++)
  {
     my_docs.push(tmp);
  }
  db.collection('mycollection').insert(my_docs,{w:1}, function(err, result) {...
  </code></pre>
  
  <p>This is very strange. Any ideas on how to proceed to debug this?</p>
  
  <p>If I do manual insert from commandline, it works and no key duplications.</p>