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: make findOneAndDelete() without options return result doc, not ModifyResult #14153

Merged
merged 2 commits into from Dec 5, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #14130

Summary

#14130 points out that, right now, calling Model.findOneAndDelete(filter) will return Query<ModifyResult<THydratedDocType>> rather than Query<THydratedDocType> because of the ?: in the & { includeResultMetadata: true } type definition.

Examples

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Dec 5, 2023
@vkarpov15 vkarpov15 merged commit 4d7f71d into master Dec 5, 2023
3 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14130 branch December 5, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect return type for doc.findOneAndDelete()
2 participants