title: With bookshelf.js, how do you loop through all models in batches?
body: <p>With <a href="http://bookshelfjs.org/" rel="nofollow">bookshelf.js</a> it is easy enough to fetch all records for a given model using <a href="http://bookshelfjs.org/#Model-fetchAll" rel="nofollow">Model.fetchAll</a> and then loop through them, like so:</p>
  
  <pre><code>SomeModel.fetchAll().then(function(results) {
      results.models.forEach(function(model) {
          ...
      });
  });
  </code></pre>
  
  <p>But this loads the entire result set all at once, which is impractical for very large result sets. Is there a simple way to load the results in smaller batches (e.g. only 1000 at a time, say).</p>
  
  <p>I know it's possible to do this by maintaining an offset counter and using limit() and offset() to roll my own version of this, but really I'm looking for something that hides the nuts and bolts, analogous to ActiveRecord's <a href="http://api.rubyonrails.org/classes/ActiveRecord/Batches.html#method-i-find_in_batches" rel="nofollow">find_in_batches</a>.</p>
  
  <p>But I can't find anywhere in the docs or from a google search if a batched fetcher method even exists. Is there a simple way to do this?</p>