yii\mongodb\Migration::save PHP Method

save() public method

Update the existing database data, otherwise insert this data
public save ( array | string $collection, array | object $data, array $options = [] ) : MongoDB\BSON\ObjectID
$collection array | string collection name.
$data array | object data to be updated/inserted.
$options array list of options in format: optionName => optionValue.
return MongoDB\BSON\ObjectID updated/new record id instance.
    public function save($collection, $data, $options = [])
    {
        $this->beginProfile($token = "    > save " . $this->composeCollectionLogName($collection) . ") ...");
        $id = $this->db->getCollection($collection)->save($data, $options);
        $this->endProfile($token);
        return $id;
    }