createCollection() public method
Creates new collection.
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 boolean createCollection ( $name, $options = [] ) | ||
---|---|---|
$name | string |
Name of the collection |
$options | array |
Collection options in format: "name" => "value" |
return | boolean |
Whether operation was successful. |
throws | yii\mongodb\Exception |
on failure. |
Please login to continue.