title: Mongo / Ruby driver output specific number of documents at a time?
body: <p>Ruby Mongo Driver question:</p>
  
  <p>How do I output 5_000 document batches from the collection at a time until I read the last document in the collection without dumping the entire database into memory first?</p>
  
  <p><em>This is really bad method for me</em>:</p>
  
  <pre><code>mongo = MongoClient.new('localhost', 27017)['sampledb']['samplecoll']
  @whois.find.to_a....
  </code></pre>