public function createIndex($collection, $columns, $options = [])
    {
        $this->beginProfile($token = "    > create index on " . $this->composeCollectionLogName($collection) . " (" . Json::encode((array) $columns) . empty($options) ? "" : ", " . Json::encode($options) . ") ...");
        $this->db->getCollection($collection)->createIndex($columns, $options);
        $this->endProfile($token);
    }
public function createIndex($collection, $columns, $options = [])
    {
        $this->beginProfile($token = "    > create index on " . $this->composeCollectionLogName($collection) . " (" . Json::encode((array) $columns) . empty($options) ? "" : ", " . Json::encode($options) . ") ...");
        $this->db->getCollection($collection)->createIndex($columns, $options);
        $this->endProfile($token);
    }
public function createIndex ( $ collection , $ columns , $ options = [ ] ) { $ this -> beginProfile ( $ token = "    > create index on " . $ this -> composeCollectionLogName ( $ collection ) . " (" . Json :: encode ( ( array ) $ columns ) . empty ( $ options ) ? "" : ", " . Json :: encode ( $ options ) . ") ..." ) ; $ this -> db -> getCollection ( $ collection ) -> createIndex ( $ columns , $ options ) ; $ this -> endProfile ( $ token ) ; }
Creates an index on the collection and the specified fields.
@param string|array $collection name of the collection
@param array|string $columns column name or list of column names.
@param array $options list of options in format: optionName => optionValue.
Creates an index on the collection and the specified fields .