-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Unreported breaking change - insertMany with lean option #14698
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone
Comments
That's a good point, we will add this to our docs. As a workaround, you can use await MyModel.insertMany(docs.map(doc => MyModel.applyDefaults(doc)), { lean: true }) |
vkarpov15
added a commit
that referenced
this issue
Jul 4, 2024
docs(model): note that `insertMany()` with `lean` skips applying defaults
Note: This seems to have appeared in the 7.x branch as well - presumably with 7.6.10 |
This was referenced Aug 21, 2024
This was referenced Aug 23, 2024
This was referenced Aug 24, 2024
This was referenced Aug 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Issue
When this issue was raised: #14372
The fix was to skip hydration in "insertMany" - this causes a bug where insertMany suddenly does't take care for "defaults"
I think it should be mention somewhere, just wanted to point it out 🙏
Thank you very much for your work !
The text was updated successfully, but these errors were encountered: