Skip to content

Commit

Permalink
fix(aggregte): support user-provided batchSize
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Apr 18, 2018
1 parent ec6a028 commit ad10dee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2430,7 +2430,8 @@ Collection.prototype.aggregate = function(pipeline, options, callback) {
throw toError('cursor options must be an object');
}

options.cursor = options.cursor || { batchSize: 1000 };
options.cursor = options.cursor || {};
if (options.batchSize) options.cursor.batchSize = options.batchSize;
command.cursor = options.cursor;

// promiseLibrary
Expand Down

0 comments on commit ad10dee

Please sign in to comment.