Create mongoose validationError
object similar to mongodb error in insertMany
#14351
Open
2 tasks done
Labels
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
new feature
This change adds new functionality, like a new method or class
Milestone
Prerequisites
🚀 Feature Proposal
In mongoose, when we use
insertMany
with{ordered:false, rawResult: true, throwValidationError: true}
, it return this type of error when there are only mongoose validation error.Motivation
here I can get the index if there is mongodb error with validationError. but still can not get the doc details which was validated.
Example
current validationError :
expected validationError in insertMany :
The text was updated successfully, but these errors were encountered: