MongoDB::drop

(PECL mongo >=0.9.0)

MongoDB::dropDrops this database

Descrierea

public MongoDB::drop ( void ) : array

This drops the database currently being used.

This is identical to running:

<?php

public function drop() {
    
$this->command(array("dropDatabase" => 1));
}

?>

Parametri

Această funcție nu are parametri.

Valorile întoarse

Returns the database response.

Exemple

Example #1 MongoDB::drop() example

This example demonstrates how to drop a mongo database and the response to expect.

<?php

$db 
$mongo->foo;
$response $db->drop();
print_r($response);

?>

Exemplul de mai sus va afișa ceva similar cu:

Array
(
    [dropped] => foo.$cmd
    [ok] => 1
)