DBAtlas · Database operations atlas

121: DocumentValidationFailure

MongoDB

What does it mean?

The document being inserted or updated was rejected because it does not satisfy the JSON Schema validation rules (validator) defined on the collection.

Why does it happen?

The document does not conform to the schema: a missing required field, a wrong BSON type, a value outside the allowed range/pattern, additional fields being forbidden, or a rule violation while validationAction is 'error'.

How to fix it

Inspect the error details (errInfo) to see which rule was violated. Make the document conform to the schema: add required fields and correct the types. Review the collection validator with collMod. validationLevel/validationAction can be relaxed temporarily, but keeping the rules is preferable for data quality.

Open in DBAtlas →

More from this engine