Open itamar-owlytics opened 1 year ago
I know that estimatedDocumentCount
method is faster than countDocuments
method because the first use the collection metadata but I think that this change is required
https://mongoosejs.com/docs/api/model.html#model_Model-estimatedDocumentCount https://mongoosejs.com/docs/api/model.html#model_Model-countDocuments
countDocuments
method use the pre count hook and then we got the right number of itemsFor example: I have 'users' collection in mongoDB and I use the next models:
Both models use the
users
collection but in the Staff list page I expect to receive only the staff members from theusers
collection - and it's works - But the count number next to the List label is still same as in the Users page