yii\mongodb\Database::createCollection PHP Method

createCollection() public method

Note: Mongo creates new collections automatically on the first demand, this method makes sense only for the migration script or for the case you need to create collection with the specific options.
public createCollection ( string $name, array $options = [] ) : boolean
$name string name of the collection
$options array collection options in format: "name" => "value"
return boolean whether operation was successful.
    public function createCollection($name, $options = [])
    {
        return $this->createCommand()->createCollection($name, $options);
    }