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

createIndex() public method

Create a single index for the collection.
See also: Collection::createIndexes()
public createIndex ( array | object $key, array $options = [] ) : string
$key array | object Document containing fields mapped to values, which denote order or an index type
$options array Index options
return string The name of the created index
    public function createIndex($key, array $options = [])
    {
        return current($this->createIndexes([['key' => $key] + $options]));
    }