diff --git a/source/core/schema-validation.txt b/source/core/schema-validation.txt index ad2929e62ca..14276630428 100644 --- a/source/core/schema-validation.txt +++ b/source/core/schema-validation.txt @@ -17,6 +17,8 @@ Schema Validation MongoDB provides the capability to perform schema validation during updates and insertions. +.. _schema-validation-document: + Specify Validation Rules ------------------------ diff --git a/source/includes/fact-validate-standalone-inconsistencies.rst b/source/includes/fact-validate-standalone-inconsistencies.rst index 6e48632f1ca..93bbfb6128b 100644 --- a/source/includes/fact-validate-standalone-inconsistencies.rst +++ b/source/includes/fact-validate-standalone-inconsistencies.rst @@ -10,4 +10,8 @@ Index inconsistencies include: If any inconsistencies are detected by the :method:`db.collection.validate()` command, a warning is returned -and the repair flag on the index is set to ``true``. \ No newline at end of file +and the repair flag on the index is set to ``true``. + +:method:`db.collection.validate()` also validates any documents that +violate the collection's +:ref:`schema validation rules `. \ No newline at end of file diff --git a/source/release-notes/5.0.txt b/source/release-notes/5.0.txt index bb73baf894c..e6110f1bd0a 100644 --- a/source/release-notes/5.0.txt +++ b/source/release-notes/5.0.txt @@ -761,6 +761,15 @@ The :dbcommand:`validate` command and :method:`db.collection.validate()` helper method also return a new :data:`~validate.repaired` boolean value that is ``true`` if the collection was repaired. +``validate`` Command Reports Document Schema Violations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Starting in MongoDB 5.0, :dbcommand:`validate` and +:method:`db.collection.validate()` validates documents +in a collection. The commands report if any +:ref:`schema validation rules ` are +violated. + Repair Option in ``mongod`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~