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

fix(model): ignore falsy last argument to create() for backwards compatibility #13493

Merged
merged 1 commit into from Jun 9, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13487
Re: #5061

Summary

Mongoose 6 used to ignore falsy last arguments to Model.create(), Mongoose 7 removed support for that behavior because we removed support for callbacks. In the interest of backwards compat, we should make await Model.create(doc, undefined) work like how it did in Mongoose 6.

Examples

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. 👍

@vkarpov15 vkarpov15 merged commit efe16d2 into master Jun 9, 2023
33 of 34 checks passed
@vkarpov15 vkarpov15 added this to the 7.2.3 milestone Jun 9, 2023
@hasezoey hasezoey deleted the vkarpov15/gh-13487 branch June 9, 2023 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants