downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoDB::dropCollection> <MongoDB::createDBRef
[edit] Last updated: Fri, 24 Feb 2012

view this page in

MongoDB::drop

(PECL mongo >=0.9.0)

MongoDB::dropDrops this database

Descrição

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

?>

Parâmetros

Esta função não contém parâmetros.

Valor Retornado

Returns the database response.

Exemplos

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

?>

O exemplo acima irá imprimir algo similar a:

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


add a note add a note User Contributed Notes MongoDB::drop
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites