Sokil\Mongo\Collection::deleteIndex PHP Method

deleteIndex() public method

Delete index
public deleteIndex ( array $key ) : Collection
$key array
return Collection
    public function deleteIndex(array $key)
    {
        $this->getMongoCollection()->deleteIndex($key);
        return $this;
    }

Usage Example

Example #1
0
 public function testDeleteIndex()
 {
     $this->collection->ensureIndex(array('asc' => 1, 'desc' => -1));
     $this->collection->deleteIndex(array('asc' => 1, 'desc' => -1));
     $indexes = $this->collection->getIndexes();
     $this->assertEquals(1, count($indexes));
 }