PHP Portal » PHP Handbuch » MongoCollection::deleteIndex

Werbung

MongoCollection::deleteIndex


(PECL mongo >=0.9.0)

MongoCollection::deleteIndexDeletes an index from this collection

Beschreibung

public array MongoCollection::deleteIndex ( string|array $keys )

Parameter-Liste

keys

Field or fields from which to delete the index.

Rückgabewerte

Returns the database response.

Beispiele

Beispiel #1 MongoCollection::deleteIndex() example

This example passes the function string and array parameters.

PHP Code
1
2
3
4
5
6
7
8
9
10
11
$m = new Mongo(); $c = $m->example->indices; // create an index $c->ensureIndex(array("i"=>1)); // remove a simple index $c->deleteIndex("i"); // create a multi-key index $c->ensureIndex(array("j" => 1, "k" => 1)); // remove a multi-key index $c->deleteIndex(array("j" => 1, "k" => 1));