本文整理汇总了PHP中MongoCollection::deleteIndexes方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoCollection::deleteIndexes方法的具体用法?PHP MongoCollection::deleteIndexes怎么用?PHP MongoCollection::deleteIndexes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoCollection
的用法示例。
在下文中一共展示了MongoCollection::deleteIndexes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eliminarIndicesATablaTemporal
function eliminarIndicesATablaTemporal($TABLA)
{
try {
$DB = $this->CONEXION->innet;
$COLECCION = new MongoCollection($DB, "temporal" . $TABLA);
$COLECCION->deleteIndexes();
} catch (Exception $e) {
$this->LOG->registraLog("Generica", $e->getMessage(), "No es posible crear un indice " . $TABLA);
return false;
}
return $DATOS["_id"];
}
示例2: testDeleteIndexes
public function testDeleteIndexes()
{
$idx = $this->object->db->selectCollection('system.indexes');
$this->object->ensureIndex(array('foo' => 1));
$this->object->ensureIndex(array('foo' => -1));
$this->object->ensureIndex(array('bar' => 1, 'baz' => -1));
$num = iterator_count($idx->find(array('ns' => 'phpunit.c')));
$this->assertEquals($num, 4);
$this->object->deleteIndexes();
$num = iterator_count($idx->find(array('ns' => 'phpunit.c')));
$this->assertEquals($num, 1);
}
示例3: deleteIndexes
/**
* Wrapper method for MongoCollection::deleteIndexes().
*
* @see http://php.net/manual/en/mongocollection.deleteindexes.php
* @return array
*/
public function deleteIndexes()
{
return $this->mongoCollection->deleteIndexes();
}
示例4: MongoClient
<?php
error_reporting(E_ALL);
// connect
$m = new MongoClient();
// select a database
$db = $m->selectDB('trend');
// select a collection (analogous to a relational database's table)
$colnames = ['housesale', 'aptsale', 'flatsale', 'houserent', 'aptrent', 'flatrent'];
foreach ($colnames as $colname) {
echo "Removing {$colname}...\n";
$col = new MongoCollection($db, $colname);
$col->drop();
$col->deleteIndexes();
$col2name = $colname . "_agg";
$col2 = new MongoCollection($db, $col2name);
$col2->drop();
$col2->deleteIndexes();
}
示例5: deleteIndexes
/**
* deleteIndexes.
*/
public function deleteIndexes()
{
$this->time->start();
$return = parent::deleteIndexes();
$time = $this->time->stop();
$this->log(array('type' => 'deleteIndexes', 'time' => $time));
return $return;
}
示例6: dropIndexes
/**
* @return array
*/
public function dropIndexes()
{
return $this->collection->deleteIndexes();
}