-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Logging
-
None
When creating or updating an invalid document on a collection that has validation the error message that comes up is far too generic
WriteResult({ "nInserted" : 0, "writeError" : { "code" : 121, "errmsg" : "Document failed validation" } })
Could the team please implement something nicer that i possibly includes the description and or the key name
like if the validation looked like
gpa: { bsonType: [ "double" ], description: "must be a double and is required" }
And somebody entered an incorrect validation the error message back could include
validationErrors: [ Gpa must be a double and is required]
With the validation at its current state its pretty useless for an application level and the validation would need to be duplicated on the application level as well as the db level.
Thanks
- duplicates
-
SERVER-20547 Expose the reason an operation fails document validation
- Closed