We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
8.0.2
20.10.0
6.2.0
5.3.2
The return type for doc.findOneAndDelete(...) is of type ModifyResult while MongoDB returns the document
doc.findOneAndDelete(...)
ModifyResult
See return type for MongoDB here and the type definition here
Expected that the return type is the document, not ModifyResult
The text was updated successfully, but these errors were encountered:
can confirm this exact behaviour as well
Sorry, something went wrong.
it was handled temporarily
- const session = await Session.findOneAndDelete({ sessionToken }) // return ModifyResult<SessionDocument> + const session = await Session.findOneAndDelete({ sessionToken }, {}) // return SessionDocument
types: make findOneAndDelete() without options return result doc, not…
f0f7e75
… ModifyResult Fix #14130
Merge branch 'master' into vkarpov15/gh-14130
ffdb091
Merge pull request #14153 from Automattic/vkarpov15/gh-14130
4d7f71d
types: make findOneAndDelete() without options return result doc, not ModifyResult
Successfully merging a pull request may close this issue.
Prerequisites
Mongoose version
8.0.2
Node.js version
20.10.0
MongoDB server version
6.2.0
Typescript version (if applicable)
5.3.2
Description
The return type for
doc.findOneAndDelete(...)
is of typeModifyResult
while MongoDB returns the documentSteps to Reproduce
See return type for MongoDB here and the type definition here
Expected Behavior
Expected that the return type is the document, not
ModifyResult
The text was updated successfully, but these errors were encountered: