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
Instead of `doc.array[i] = whatever`, which requires n setters created on every MongooseArray, we implement `doc.array.set(i, whatever)` which gives us a single entry point for casting. This change introduces the possibility of adding nulls into DocumentArrays as a side affect of assigning a value to an index larger than the arrays current length + 1: doc.array.set(doc.array.length + 1, something) Previously, DocumentArrays did not support nulls.