balderdashy / waterline-docs

WARNING: The content in this repo is out of date! See https://github.com/balderdashy/sails-docs for the most up-to-date documentation
452 stars 163 forks source link

MongoDB record count discrepancy between Native .find() and Sails .find() #133

Open wlemahieu opened 7 years ago

wlemahieu commented 7 years ago

It seems like there's an issue with how Model.Native works when using .find(). I was trying to figure out why a query I was running manually in MongoDB was returning 2310 records, but through Sails Native .find(), it was only returning 1000 records. When using the exact same query parameters but changing from Model.Native Collection.Find to just Sail's simpler Model.Find is all it took to bypass the issue. The count should be the same whether using Native or not. It's like an invisible limit(1000) is being applied, but even setting limit(0) doesn't resolve it for Native.