|
RE: http://docs.mongodb.org/manual/core/cursors/#cursor-batches
Subsequent batch size is 4 megabytes. To override the default size of the batch, see batchSize() and limit().
These 3 things are all orthogonal.
- The 4MB limit per "getMore" is an absolute compiled-in constant:
https://github.com/mongodb/mongo/blob/v3.0/src/mongo/db/query/find.cpp#L71
- The "batchSize" parameter affects how many documents will be returned in a getMore at most (the wording above suggests it can override the 4MB, but it can't, it merely applies as well as the 4MB limit).
- The "limit" parameter determines the number of documents that can be enumerated by the cursor in total - if that number fits in the first batch then the cursor terminates, but if it doesn't then the cursor batch mechanism works as normal - "limit" can perhaps be thought of as the sum of document counts in all batches.
|