mongodb\Database createCollection()

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.

doc_Yii
2016-10-30 17:08:06
Comments
Leave a Comment

Please login to continue.