You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
govindrai opened this issue
Oct 28, 2018
· 3 comments
Labels
docsThis issue is due to a mistake or omission in the mongoosejs.com documentationhelpThis issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
When I invoke a Model.find() query, if there are a million docs in the database, will all million be returned? What is the output if there are still more documents to query from the database than are returned? I couldn't find this in the docs (except for information on cursor, which I hope I don't need to use). Thanks!
The text was updated successfully, but these errors were encountered:
govindrai
changed the title
What is the limit for number of docs returned in a find query?
What is the limit for number of docs returned in a query?
Oct 28, 2018
if there are a million docs in the database, will all million be returned?
Yes. The native driver will attempt to return all of the docs that match your query right up until the point where your node process runs out of memory.
What is the output if there are still more documents to query from the database than are returned?
All matching documents will be returned or you will run out of heap space and your node process will fail.
@vkarpov15 should we add a note to this effect in the docs somewhere?
lineus
added
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
labels
Oct 31, 2018
You can use limit() to limit the number of docs your query returns, or cursor() to process documents one at a time. Otherwise, find() will give you an array of all documents that match the filter parameter.
docsThis issue is due to a mistake or omission in the mongoosejs.com documentationhelpThis issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
When I invoke a Model.find() query, if there are a million docs in the database, will all million be returned? What is the output if there are still more documents to query from the database than are returned? I couldn't find this in the docs (except for information on cursor, which I hope I don't need to use). Thanks!
The text was updated successfully, but these errors were encountered: