MongoDB::drop

(PECL mongo >=0.9.0)

MongoDB::dropDrops this database

Beskrivelse

public array MongoDB::drop ( void )

This drops the database currently being used.

This is identical to running:

<?php

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

?>

Parametre

This function has no parameters.

Returnerings Værdier

Returns the database response.

Eksempler

Eksempel #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);

?>

The above example will output something similar to:

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

User Contributed Notes

There are no user contributed notes for this page.
To Top