title: mongodb doesn't save all data
body: <p>I need to insert some matrix in mongodb,so I wrote simple following code</p>
  
  <pre><code>var MongoClient = require('mongodb').MongoClient;    
  var matrisMaker = function(d1,d2){
      var result = new Array();
      for (var i = 0;i &lt; d1;i++){
          result.push(new Array());
          for (var k = 0;k &lt; d2;k++){
              result[i].push(Math.round(Math.random() * 1000000000000));
          }
      }
      return result;
  };
  
    MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
      if(err) throw err;
  
      var collection = db.collection('matris');
  
      for (var counter = 0;counter &lt; 10000000;counter++){
          var insertObject = {
                  'matrisA':matrisMaker(20,20),
                  'matrisB':matrisMaker(20,20),
                  'resultA':new Object(),
                  'resultB':new Object()
          };
          collection.insert(insertObject, function(err, docs) {
              if (err)
                  throw err;
          });
          delete insertObject;
          if ((counter % 1000) == 0)
              console.log(counter);
      }
      db.close();
    })
  </code></pre>
  
  <p>when I see log it printed that too many records inserted,like 50,000,but when I use mongodb to count amount of records,it display less,something near 1,000 records.</p>
  
  <pre><code>&gt;use test;
  &gt;db.matris.count();
  </code></pre>
  
  <p>where is the problem?</p>