Skip to content

Commit 3edaa86

Browse files
committed
fixed; remove query batchSize option default
Bug in MongoDB breaks result sets: SERVER-5374 Originally added to make streaming large result sets behave nicely (otherwise huge 100000+ doc sets may be returned when not specified). If you are streaming large query results and experience bad performance, you may want to set the batchSize option: query.batchSize(1000) Keep in mind that at this time (mongo 2.2) if the query also uses a sort(), you will need to add an index to that field to ensure all results are returned. https://jira.mongodb.org/browse/SERVER-5374 http://stackoverflow.com/questions/12643195/mongoose-limiting-query-to-1000-results-when-i-want-more-all-migrating-from-2-6
1 parent 4f28c52 commit 3edaa86

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/query.js

-3
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,6 @@ Query.prototype._optionsForExec = function (model) {
361361
var options = utils.clone(this.options, { retainKeyOrder: true });
362362
delete options.populate;
363363

364-
if (!('batchSize' in options))
365-
options.batchSize = 1000;
366-
367364
if (!('safe' in options))
368365
options.safe = model.schema.options.safe;
369366

0 commit comments

Comments
 (0)