SoftwareBrothers / adminjs-mongoose

Mongoose adapter for AdminJS
MIT License
14 stars 39 forks source link

Use estimatedDocumentCount instead of count #75

Closed rafa-js closed 2 years ago

rafa-js commented 2 years ago

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 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.

rafa-js commented 2 years ago

Cool! Any thoughts on the release for this change? @dziraf

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 2.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: