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

Incorrect return type for doc.findByIdAndDelete() #14199

Closed
2 tasks done
markiewiczjakub opened this issue Dec 28, 2023 · 1 comment
Closed
2 tasks done

Incorrect return type for doc.findByIdAndDelete() #14199

markiewiczjakub opened this issue Dec 28, 2023 · 1 comment

Comments

@markiewiczjakub
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

8.0.3

Node.js version

18.19.0

MongoDB server version

6.2.0

Typescript version (if applicable)

5.1.6

Description

The return type for doc.findByIdAndDelete(...) is of type ModifyResult while MongoDB returns the document

Similiar issue but on different method: #14130

Steps to Reproduce

await doc.findByIdAndDelete(id).exec(); // ModifyResult
await doc.findByIdAndDelete(id, {}).exec(); // Document

Expected Behavior

Expecting return type to be the document, not ModifyResult

@markiewiczjakub
Copy link
Author

#14190

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

No branches or pull requests

1 participant