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, 25 May 2012

view this page in

MongoDB::drop

(PECL mongo >=0.9.0)

MongoDB::dropこのデータベースを削除する

説明

public array MongoDB::drop ( void )

これは、現在使っているデータベースを削除します。

次のコードと同じ意味です。

<?php

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

?>

パラメータ

この関数にはパラメータはありません。

返り値

データベースの応答を返します。

例1 MongoDB::drop() の例

この例は、mongo データベースを削除する方法とその応答を示します。

<?php

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

?>

上の例の出力は、 たとえば以下のようになります。

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