翻译或纠错本页面
- Reference >
- mongo Shell Methods >
- Collection Methods >
- db.collection.validate()
db.collection.validate()¶
Description¶
- db.collection.validate(full)¶
Validates a collection. The method scans a collection’s data structures for correctness and returns a single document that describes the relationship between the logical collection and the physical representation of the data.
The validate() method has the following parameter:
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 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 validate() method is a wrapper around the validate database command.
参见