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

types(document): correct return type for Model.prototype.deleteOne(): promise, not query #13367

Merged
merged 1 commit into from May 2, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13223

Summary

As implemented, doc.deleteOne() returns a promise, not a query. We could either update the deleteOne() implementation to match updateOne(), which does return a query; or we update the TypeScript types. I think changing the TS types is the way to go, because it is less backwards breaking. But we should consider changing doc.deleteOne() to return a query in the next major release.

Examples

@hasezoey
Copy link
Collaborator

hasezoey commented May 2, 2023

But we should consider changing doc.deleteOne() to return a query in the next major release.

yes, is there a issue for tracking / reminder already?

@vkarpov15
Copy link
Collaborator Author

@hasezoey I just opened one, #13369.

@vkarpov15 vkarpov15 merged commit 1c4e6a9 into master May 2, 2023
3 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/deleteone-ts branch May 2, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document.deleteOne(...).exec is not a function
2 participants