Closed rafa-js closed 2 years ago
Model.count() is deprecated https://mongoosejs.com/docs/api.html#model_Model.count and actually doesn't work properly with massive collections (+2M records).
Model.count()
Use estimatedDocumentCount instead of count as recommended by Mongoose. Also, it fixes a bug where count won't work if the collection has more than 2M records. I tested myself in a project.
estimatedDocumentCount
count
Cool! Any thoughts on the release for this change? @dziraf
:tada: This PR is included in version 2.0.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Overview
Model.count()
is deprecated https://mongoosejs.com/docs/api.html#model_Model.count and actually doesn't work properly with massive collections (+2M records).Use
estimatedDocumentCount
instead ofcount
as recommended by Mongoose. Also, it fixes a bug wherecount
won't work if the collection has more than 2M records. I tested myself in a project.