Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 3edaa8651e31af382a8a16bfc9aaefe0b657f68d 1 parent 4f28c52
@aheckmann aheckmann authored
Showing with 0 additions and 3 deletions.
  1. +0 −3  lib/query.js
View
3  lib/query.js
@@ -361,9 +361,6 @@ Query.prototype._optionsForExec = function (model) {
var options = utils.clone(this.options, { retainKeyOrder: true });
delete options.populate;
- if (!('batchSize' in options))
- options.batchSize = 1000;
-
if (!('safe' in options))
options.safe = model.schema.options.safe;
Please sign in to comment.
Something went wrong with that request. Please try again.