Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript -- MongooseQueryMiddleware not include countDocuments and estimatedDocumentCount but only count #12516

Closed
1 task done
LucaIaconelli opened this issue Oct 4, 2022 · 2 comments · Fixed by #12519
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

Comments

@LucaIaconelli
Copy link

Prerequisites

  • I have written a descriptive issue title

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 and estimatedDocumentCount are missing, and if I'm using count, the other two not works as expected.

Could you kindly help to solve this problem?

Thanks

@LucaIaconelli LucaIaconelli added help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary help wanted labels Oct 4, 2022
@hasezoey hasezoey added confirmed-bug We've confirmed this is a bug in Mongoose and will fix it. typescript Types or Types-test related issue / Pull Request and removed help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary help wanted labels Oct 4, 2022
hasezoey added a commit to hasezoey/mongoose that referenced this issue Oct 4, 2022
@hasezoey hasezoey added this to the 6.6.5 milestone Oct 4, 2022
@LucaIaconelli
Copy link
Author

@hasezoey Thank you very much. When is 6.6.5 expected to be released?

@hasezoey
Copy link
Collaborator

hasezoey commented Oct 5, 2022

When is 6.6.5 expected to be released?

guessing by the average time patch versions are released, within the next 2 weeks at the longest, but more commonly within ~7 days from the point of the last patch version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants