title: Node.js mongclient batchsize
body: <p>I am having problem with while trying to fetch  10,000 rows from mongdb collection using mongodb native client. It works upto batchsize of around 9700 records but returns no data for any larger batchSize. Here is the code snippet .. .. Any ideas what preventing it??</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.get('/aps/allclients' , function(req,res) {
  
  MongoClient.connect(url, function(err, db) {
    var collection = db.collection('allclients');
    collection.find({},{"batchSize":10000}).toArray(function(err, docs){ // works for batch size 9700 or less but not 10000
     
      res.send(JSON.stringify(docs));
    });
    db.close();
   });
  
  });</code></pre>
  </div>
  </div>
  </p>