Bug Report - Harcoded 20 documents limit
M-Gonzalo opened this issue · 2 comments
M-Gonzalo commented
Bug Report
Current Behavior
No matter how I build my queries, they're limited to 20 items, even if I use the .limit() operator
Code/Gist
Expected Behavior/Code
Environment
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.4.8-arch1-1 snap
Possible Solution
Additional Context/Screenshots
Anemy commented
Hi @M-Gonzalo Tthe query is returning a cursor which by default will only return 20 documents. To get all of the documents you can use .toArray()
, documentation: https://www.mongodb.com/docs/manual/reference/method/cursor.toArray/#:~:text=For%20MongoDB%20API%20drivers%2C%20refer,RAM%20and%20exhausting%20the%20cursor.
M-Gonzalo commented
Sorry for the misunderstanding. Thanks for your reply!