Skip to content

Commit 23b165a

Browse files
authored
DOCS-14535 add additional validate context to validate page (#6019)
1 parent 131bc5d commit 23b165a

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

source/core/schema-validation.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Schema Validation
1717
MongoDB provides the capability to perform schema validation during
1818
updates and insertions.
1919

20+
.. _schema-validation-document:
21+
2022
Specify Validation Rules
2123
------------------------
2224

source/includes/fact-validate-standalone-inconsistencies.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ Index inconsistencies include:
1010

1111
If any inconsistencies are detected by the
1212
:method:`db.collection.validate()` command, a warning is returned
13-
and the repair flag on the index is set to ``true``.
13+
and the repair flag on the index is set to ``true``.
14+
15+
:method:`db.collection.validate()` also validates any documents that
16+
violate the collection's
17+
:ref:`schema validation rules <schema-validation-document>`.

source/release-notes/5.0.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,15 @@ The :dbcommand:`validate` command and :method:`db.collection.validate()`
761761
helper method also return a new :data:`~validate.repaired` boolean value
762762
that is ``true`` if the collection was repaired.
763763

764+
``validate`` Command Reports Document Schema Violations
765+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
766+
767+
Starting in MongoDB 5.0, :dbcommand:`validate` and
768+
:method:`db.collection.validate()` validates documents
769+
in a collection. The commands report if any
770+
:ref:`schema validation rules <schema-validation-document>` are
771+
violated.
772+
764773
Repair Option in ``mongod``
765774
~~~~~~~~~~~~~~~~~~~~~~~~~~~
766775

0 commit comments

Comments
 (0)