deleteIndexes() public method

Delete all indexes for this collection
public deleteIndexes ( ) : array
return array Returns the database response.
コード例 #1
0
 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
0
 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
0
ファイル: Collection.php プロジェクト: pmnyaga/mongodb
 /**
  * Wrapper method for MongoCollection::deleteIndexes().
  *
  * @see http://php.net/manual/en/mongocollection.deleteindexes.php
  * @return array
  */
 public function deleteIndexes()
 {
     return $this->mongoCollection->deleteIndexes();
 }
コード例 #4
0
ファイル: clear_all.php プロジェクト: hunkim/kproperty
<?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
0
ファイル: LoggableMongoCollection.php プロジェクト: hybr/jpm
 /**
  * deleteIndexes.
  */
 public function deleteIndexes()
 {
     $this->time->start();
     $return = parent::deleteIndexes();
     $time = $this->time->stop();
     $this->log(array('type' => 'deleteIndexes', 'time' => $time));
     return $return;
 }
コード例 #6
0
ファイル: MongoGateway.php プロジェクト: pasechnik/mongozend
 /**
  * @return array
  */
 public function dropIndexes()
 {
     return $this->collection->deleteIndexes();
 }