Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15364

Add more detail on what validate considers "invalid documents"

    XMLWordPrintableJSON

Details

    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

      Attachments

        Activity

          People

            jason.price@mongodb.com Jason Price
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 36 weeks, 6 days ago