发布于 2015-09-14 15:12:46 | 92 次阅读 | 评论: 0 | 来源: 网络整理
The collection validation command checks all of the structures within a name space for correctness and returns a document containing information regarding the on-disk representation of the collection.
警告
The validate process may consume significant system resources and impede application performance because it must scan all data in the collection.
Run the validation command in the mongo shell using the following form to validate a collection named people:
db.people.validate()
Alternatively you can use the command prototype and the db.runCommand() shell helper in the following form:
db.runCommand( { validate: "people", full: true } )
db.people.validate(true)
也可以参考
validate and validate().
The full namespace name of the collection. Namespaces include the database name and the collection name in the form database.collection.
The disk location of the first extent in the collection. The value of this field also includes the namespace.
The disk location of the last extent in the collection. The value of this field also includes the namespace.
The number of extents in the collection.
validate returns one instance of this document for every extent in the collection. This sub-document is only returned when you specify the full option to the command.
The disk location for the beginning of this extent.
The disk location for the extent following this one. “null” if this is the end of the linked list of extents.
The disk location for the extent preceding this one. “null” if this is the head of the linked list of extents.
The namespace this extent belongs to (should be the same as the namespace shown at the beginning of the validate listing).
The number of bytes in this extent.
The disk location of the first record in this extent.
The disk location of the last record in this extent.
The number of bytes in all data records. This value does not include deleted records, nor does it include extent headers, nor record headers, nor space in a file unallocated to any extent. datasize includes record padding.
The size of the last new extent created in this collection. This value determines the size of the next extent created.
A floating point value between 1 and 2.
When MongoDB creates a new record it uses the padding factor to determine how much additional space to add to the record. The padding factor is automatically adjusted by mongo when it notices that update operations are triggering record moves.
The size of the first extent created in this collection. This data is similar to the data provided by the extents sub-document; however, the data reflects only the first extent in the collection and is always returned.
The disk location for the beginning of this extent.
The disk location for the extent following this one. “null” if this is the end of the linked list of extents, which should only be the case if there is only one extent.
The disk location for the extent preceding this one. This should always be “null.”
The namespace this extent belongs to (should be the same as the namespace shown at the beginning of the validate listing).
The number of bytes in this extent.
The disk location of the first record in this extent.
The disk location of the last record in this extent.
The number of records actually encountered in a scan of the collection. This field should have the same value as the nrecords field.
The number of records containing BSON documents that do not pass a validation check.
注解
This field is only included in the validation output when you specify the full option.
This is similar to datasize, except that bytesWithHeaders includes the record headers. In version 2.0, record headers are 16 bytes per document.
注解
This field is only included in the validation output when you specify the full option.
bytesWithoutHeaders returns data collected from a scan of all records. The value should be the same as datasize.
注解
This field is only included in the validation output when you specify the full option.
The number of deleted or “free” records in the collection.
The size of all deleted or “free” records in the collection.
The number of indexes on the data in the collection.
A document containing a field for each index, named after the index’s name, that contains the number of keys, or documents referenced, included in the index.
Boolean. true, unless validate determines that an aspect of the collection is not valid. When false, see the errors field for more information.