Skip to content

DOCS-14535 add additional validate context to validate page #6019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/core/schema-validation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Schema Validation
MongoDB provides the capability to perform schema validation during
updates and insertions.

.. _schema-validation-document:

Specify Validation Rules
------------------------

Expand Down
6 changes: 5 additions & 1 deletion source/includes/fact-validate-standalone-inconsistencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
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 <schema-validation-document>`.
9 changes: 9 additions & 0 deletions source/release-notes/5.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <schema-validation-document>` are
violated.

Repair Option in ``mongod``
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down