yii\mongodb\Migration::createIndexes PHP Method

createIndexes() public method

Creates indexes in the collection.
Since: 2.1
public createIndexes ( string | array $collection, array $indexes )
$collection string | array name of the collection
$indexes array indexes specifications.
    public function createIndexes($collection, $indexes)
    {
        $this->beginProfile($token = "    > create indexes on " . $this->composeCollectionLogName($collection) . " (" . Json::encode($indexes) . ") ...");
        $this->db->getCollection($collection)->createIndexes($indexes);
        $this->endProfile($token);
    }