/
db.collection.validate.txt
67 lines (44 loc) · 1.7 KB
/
db.collection.validate.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
========================
db.collection.validate()
========================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Description
-----------
.. method:: db.collection.validate(true)
Validates a collection. The method scans a collection's data
structures for correctness and returns a single :term:`document` that
describes the relationship between the logical collection and the
physical representation of the data.
The :method:`~db.collection.validate()` method has the following
parameter:
.. list-table::
:header-rows: 1
:widths: 20 20 80
* - Parameter
- Type
- Description
* - ``full``
- boolean
- Optional. Specify ``true`` to enable a full validation and to return full
statistics. MongoDB disables full validation by default because it is
a potentially resource-intensive operation.
The :method:`db.collection.validate()` method output provides an
in-depth view of how the collection
uses storage. Be aware that this command is potentially resource
intensive and may impact the performance of your MongoDB
instance.
The :method:`db.collection.validate()` method is a wrapper
around the :dbcommand:`validate` :term:`database
command`.
Behavior
--------
:method:`db.collection.validate()` obtains an exclusive lock on the
collection. This will block all reads and writes on the collection
until the operation finishes. When run on a secondary, the operation
can sblock all other operations on that secondary until it finishes.
.. seealso:: :doc:`/reference/command/validate`