文字

MongoCollection::deleteIndexes

(PECL mongo >=0.9.0)

MongoCollection::deleteIndexes删除集合的所有索引

说明

public array MongoCollection::deleteIndexes ( void )

参数

此函数没有参数。

返回值

返回数据库的响应。

范例

Example #1 MongoCollection::deleteIndexes() 例子

这个例子演示了如何从集合中删除所有索引并得到响应

<?php

$collection 
$mongo -> my_db -> articles ;
$response  $collection -> deleteIndexes ();
print_r ( $response );

?>

以上例程的输出类似于:

Array
(
    [nIndexesWas] => 1
    [msg] => all indexes deleted for collection
    [ok] => 1
)
上一篇: 下一篇: