-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Why does mongoose not export the DeleteResult
type
#14946
Labels
typescript
Types or Types-test related issue / Pull Request
Milestone
Comments
chtpl
added
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
help wanted
labels
Oct 9, 2024
You should be able to do |
vkarpov15
added
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 9, 2024
vkarpov15
added a commit
that referenced
this issue
Oct 13, 2024
types: re-export DeleteResult and UpdateResult from MongoDB Node.js driver
This was referenced Nov 9, 2024
This was referenced Nov 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Mongoose version
8.5.2
Node.js version
22.x
MongoDB version
6.x
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
22.04
Issue
I am implementing a database
deleteMany
query in a NestJS repository classI prefer declaring the return types explicitly on my methods
However when I defined
Promise<DeleteResult>
as return type for my method, I cannot find an exported memberDeleteResult
to import to my repository class file.However, type inference shows that
model.deleteMany({}).exec()
returns that type from mongoose.I wonder why this is the case as I can perfectly import
UpdateWriteOpResult
to check the updated documents count on update queriesThe text was updated successfully, but these errors were encountered: