Typescript -- MongooseQueryMiddleware not include countDocuments and estimatedDocumentCount but only count #12516
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
typescript
Types or Types-test related issue / Pull Request
Milestone
Prerequisites
Mongoose version
6.6.4
Node.js version
16.17.1
MongoDB version
4.4.17
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
22.04.1 LTS
Issue
I'm trying to create a pre-hook for my class. But I noticed that in typescript in the definition of
MongooseQueryMiddleware
there are these options:'count' | 'deleteMany' | 'deleteOne' | 'distinct' | 'find' | 'findOne' | 'findOneAndDelete' | 'findOneAndRemove' | 'findOneAndReplace' | 'findOneAndUpdate' | 'remove' | 'replaceOne' | 'update' | 'updateOne' | 'updateMany'
countDocuments
andestimatedDocumentCount
are missing, and if I'm usingcount
, the other two not works as expected.Could you kindly help to solve this problem?
Thanks
The text was updated successfully, but these errors were encountered: