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): make bulkWrite() and insertMany() throw if throwOnValidationError set and all ops invalid #14587

Merged
merged 1 commit into from
May 17, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14572

Summary

Right now we have a throwOnValidationError that means bulkWrite() and insertMany() will throw if any operations fail validation... except if all operations fail validation. This PR makes it so that we still throw a MongooseBulkWriteError if all operations fail validation.

Examples

vkarpov15 added a commit that referenced this pull request May 16, 2024
…g MongooseBulkWriteError if all valid operations succeed in bulkWrite() and insertMany()

Backport #13410
Backport #14587
Fix #14572
@vkarpov15 vkarpov15 added this to the 8.4 milestone May 17, 2024
@vkarpov15 vkarpov15 merged commit cdedde6 into master May 17, 2024
34 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-14572 branch May 17, 2024 11:37
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

Successfully merging this pull request may close these issues.

bulkWrite does not throw an error if all documents are invalid (ordered: false)
2 participants