lib/waterline/utils/query/get-query-modifier-methods.js
function(batchSizeOrIteratee, iteratee) {
    assert(this._wlQueryInfo.method === 'stream', 'Cannot chain `.eachBatch()` onto the `.'+this._wlQueryInfo.method+'()` method.  The `.eachBatch()` method is only chainable to `.stream()`.  (In fact, this shouldn\'t even be possible!  So the fact that you are seeing this message at all is, itself, likely due to a bug in Waterline.)');

    if (arguments.length > 2) {
      throw new Error('Invalid usage for `.eachBatch()` -- no more than 2 arguments should be passed in.');
    }//•

    if (iteratee === undefined) {
      this._wlQueryInfo.eachBatchFn = batchSizeOrIteratee;
    } else {
      this._wlQueryInfo.eachBatchFn = iteratee;

      // Apply custom batch size:
      // > If meta already exists, merge on top of it.
      // > (this is important for when this method is combined with .meta()/.usingConnection()/etc)
      if (this._wlQueryInfo.meta) {
        _.extend(this._wlQueryInfo.meta, { batchSize: batchSizeOrIteratee });
      }
      else {
        this._wlQueryInfo.meta = { batchSize: batchSizeOrIteratee };
      }
    }

    return this;
  }
function(batchSizeOrIteratee, iteratee) {
    assert(this._wlQueryInfo.method === 'stream', 'Cannot chain `.eachBatch()` onto the `.'+this._wlQueryInfo.method+'()` method.  The `.eachBatch()` method is only chainable to `.stream()`.  (In fact, this shouldn\'t even be possible!  So the fact that you are seeing this message at all is, itself, likely due to a bug in Waterline.)');

    if (arguments.length > 2) {
      throw new Error('Invalid usage for `.eachBatch()` -- no more than 2 arguments should be passed in.');
    }//•

    if (iteratee === undefined) {
      this._wlQueryInfo.eachBatchFn = batchSizeOrIteratee;
    } else {
      this._wlQueryInfo.eachBatchFn = iteratee;

      // Apply custom batch size:
      // > If meta already exists, merge on top of it.
      // > (this is important for when this method is combined with .meta()/.usingConnection()/etc)
      if (this._wlQueryInfo.meta) {
        _.extend(this._wlQueryInfo.meta, { batchSize: batchSizeOrIteratee });
      }
      else {
        this._wlQueryInfo.meta = { batchSize: batchSizeOrIteratee };
      }
    }

    return this;
  }
function ( batchSizeOrIteratee , iteratee ) { assert ( this . _wlQueryInfo . method === 'stream' , 'Cannot chain `.eachBatch()` onto the `.' + this . _wlQueryInfo . method + '()` method.  The `.eachBatch()` method is only chainable to `.stream()`.  (In fact, this shouldn\'t even be possible!  So the fact that you are seeing this message at all is, itself, likely due to a bug in Waterline.)' ) ; if ( arguments . length > 2 ) { throw new Error ( 'Invalid usage for `.eachBatch()` -- no more than 2 arguments should be passed in.' ) ; } //• if ( iteratee === undefined ) { this . _wlQueryInfo . eachBatchFn = batchSizeOrIteratee ; } else { this . _wlQueryInfo . eachBatchFn = iteratee ; // Apply custom batch size: // > If meta already exists, merge on top of it. // > (this is important for when this method is combined with .meta()/.usingConnection()/etc) if ( this . _wlQueryInfo . meta ) { _ . extend ( this . _wlQueryInfo . meta , { batchSize : batchSizeOrIteratee } ) ; } else { this . _wlQueryInfo . meta = { batchSize : batchSizeOrIteratee } ; } } return this ; }
Add an iteratee to the query

@param {Number|Function} batchSizeOrIteratee
@param {Function} iteratee
@returns {Query}
Add an iteratee to the query