Phalcon\Db\Adapter\MongoDB\Collection::createIndexes PHP Method

createIndexes() public method

Each element in the $indexes array must have a "key" document, which contains fields mapped to an order or type. Other options may follow. For example: $indexes = [ Create a unique index on the "username" field [ 'key' => [ 'username' => 1 ], 'unique' => true ], Create a 2dsphere index on the "loc" field with a custom name [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo' ], ]; If the "name" option is unspecified, a name will be generated from the "key" document.
See also: http://docs.mongodb.org/manual/reference/command/createIndexes/
See also: http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/
public createIndexes ( array $indexes ) : string[]
$indexes array List of index specifications
return string[] The names of the created indexes
    public function createIndexes(array $indexes)
    {
        $operation = new CreateIndexes($this->databaseName, $this->collectionName, $indexes);
        $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
        return $operation->execute($server);
    }