insert() public method
Inserts new data into collection.
public \MongoDB\BSON\ObjectID insert ( $collection, $data, $options = [] ) | ||
---|---|---|
$collection | array|string |
Collection name. |
$data | array|object |
Data to be inserted. |
$options | array |
List of options in format: optionName => optionValue. |
return | \MongoDB\BSON\ObjectID |
New record id instance. |
Please login to continue.