Details
-
Task
-
Resolution: Done
-
Major - P3
-
5.0.0, 6.0.0
-
None
Description
The validate command reports on "invalid documents" but does not elaborate on what those are: https://www.mongodb.com/docs/manual/reference/command/validate/#mongodb-data-validate.nInvalidDocuments
Invalid documents are those that are not readable according to the underlying storage engine: the BSON document is corrupt with an unexpected error or size mismatch (https://github.com/mongodb/mongo/blob/v5.0/src/mongo/db/catalog/validate_adaptor.cpp#L492)
This is extra confusing with the addition of schema validation via validate in MongoDB 5.0, as nInvalidDocument is unrelated. Documents that do no conform to schema are not counted as invalid.
In MongoDB 6.0 we added a separate nNonCompliantDocuments counter: https://www.mongodb.com/docs/v6.0/reference/command/validate/#mongodb-data-validate.nNonCompliantDocuments