Skip to content

Commit ad10dee

Browse files
committed
fix(aggregte): support user-provided batchSize
NODE-1415
1 parent ec6a028 commit ad10dee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/collection.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,8 @@ Collection.prototype.aggregate = function(pipeline, options, callback) {
24302430
throw toError('cursor options must be an object');
24312431
}
24322432

2433-
options.cursor = options.cursor || { batchSize: 1000 };
2433+
options.cursor = options.cursor || {};
2434+
if (options.batchSize) options.cursor.batchSize = options.batchSize;
24342435
command.cursor = options.cursor;
24352436

24362437
// promiseLibrary

0 commit comments

Comments
 (0)