本文整理汇总了PHP中Mongo::deleteIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP Mongo::deleteIndex方法的具体用法?PHP Mongo::deleteIndex怎么用?PHP Mongo::deleteIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mongo
的用法示例。
在下文中一共展示了Mongo::deleteIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeleteIndex
public function testDeleteIndex() {
$idx = $this->object->db->selectCollection('system.indexes');
$this->object->ensureIndex('foo');
$this->object->ensureIndex((object)array('foo' => -1));
$num = iterator_count($idx->find((object)array('ns' => 'phpunit.c')));
$this->assertEquals($num, 3);
$this->object->deleteIndex(null);
$num = iterator_count($idx->find((object)array('ns' => 'phpunit.c')));
$this->assertEquals($num, 3);
$this->object->deleteIndex((object)array('foo' => 1));
$num = iterator_count($idx->find((object)array('ns' => 'phpunit.c')));
$this->assertEquals($num, 2);
$this->object->deleteIndex('foo');
$num = iterator_count($idx->find((object)array('ns' => 'phpunit.c')));
$this->assertEquals($num, 2);
$this->object->deleteIndex((object)array('foo' => -1));
$num = iterator_count($idx->find((object)array('ns' => 'phpunit.c')));
$this->assertEquals($num, 1);
}