title: nodejs - mongodb native find all documents
body: <p>Following an example from the mongodb manual for nodejs, I am finding all documents from a db as follows</p>
  
  <pre><code>mongo.Db.connect(mongoUri, function (err, db) {
      if (err) {
          console.log(err);
      } 
      else {
          db.collection('test').find().toArray(function(e, d) {
              console.log(d.length);
              db.close();
          });
      }
  });
  </code></pre>
  
  <p>Now what I notice is that the entire set is converted to an array. As the dataset will grow, this will not be the ideal approach. Is there anyway to <strong><em>stream</em></strong> the data so it is not loaded in memory every time?</p>
  
  <p>Thanks</p>