It returns all the documents.
According to the mongoDb docs => _modifying the batch size will not affect the user or the application, as the mongo shell and most drivers return results as if MongoDB returned a single batch_
What does this mean? How is it related to mongoose?
batchSize is meant to be an internal mongodb driver construct that tells the driver how many documents to load at a time, but the driver doesn't pass the batches up to the user. General idea:
Model.find()
Generally, batchSize is primarily used for performance tuning if you're using cursors to iterate through huge data sets. You probably just want to use limit
most of the time.
Most helpful comment
batchSize is meant to be an internal mongodb driver construct that tells the driver how many documents to load at a time, but the driver doesn't pass the batches up to the user. General idea:
Model.find()
Generally, batchSize is primarily used for performance tuning if you're using cursors to iterate through huge data sets. You probably just want to use
limit
most of the time.