Closed imjiten closed 2 years ago
cc: @rseibane @dziraf
@dziraf Created another PR https://github.com/SoftwareBrothers/adminjs-mongoose/pull/80 to fix the linter issue
:tada: This PR is included in version 2.0.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
There is an issue with this change applied here https://github.com/SoftwareBrothers/adminjs-mongoose/pull/75
estimatedDocumentCount
always returns the total documents in the collection. It ignores the filers. Ref: https://www.mongodb.com/docs/manual/reference/method/db.collection.estimatedDocumentCount/#behaviorThe
count
method is still valid when you want to get the count of documents for a given filter.The change made in https://github.com/SoftwareBrothers/adminjs-mongoose/pull/75 is always returning the total documents in the collection no matter what filter is applied.
We need to add a condition to check if the filter exists and use the
estimatedDocumentCount
accordingly