Please wait while we load your page...

PasswordSentry

Latest Version [8.00202205221] Last Updated [May-22-2022]

Tools

PHP Manual [MongoDB

Protect Your Website Today


PHP Manual || MongoDB

(PECL mongo >=0.9.0)

MongoDB::dropDrops this database

Description

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));
}

?>

Parameters

This function has no parameters.

Return Values

Returns the database response.

Examples

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

?>

The above example will output something similar to:

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


PHP Manual || MongoDB