yii\mongodb\Database::createCollection PHP 메소드

createCollection() 공개 메소드

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"
리턴 boolean whether operation was successful.
    public function createCollection($name, $options = [])
    {
        return $this->createCommand()->createCollection($name, $options);
    }