Skip to content

Commit 9d7c39b

Browse files
authored
DOCS-14556 add additional validate context to validate page (#6020)
1 parent f60846a commit 9d7c39b

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
@@ -776,6 +776,15 @@ The :dbcommand:`validate` command and :method:`db.collection.validate()`
776776
helper method also return a new :data:`~validate.repaired` boolean value
777777
that is ``true`` if the collection was repaired.
778778

779+
``validate`` Command Reports Document Schema Violations
780+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
781+
782+
Starting in MongoDB 5.0, :dbcommand:`validate` and
783+
:method:`db.collection.validate()` validates documents
784+
in a collection. The commands report if any
785+
:ref:`schema validation rules <schema-validation-document>` are
786+
violated.
787+
779788
Repair Option in ``mongod``
780789
~~~~~~~~~~~~~~~~~~~~~~~~~~~
781790

0 commit comments

Comments
 (0)