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