validate() public method

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.
public validate ( boolean $full = false ) : array
$full boolean 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.
return array
Beispiel #1
0
 public function testValidateOnExistedCollection()
 {
     $this->collection->createDocument(array('param' => 1))->save();
     $result = $this->collection->validate(true);
     $this->assertInternalType('array', $result);
 }