yii\mongodb\Collection::update PHP Метод

update() публичный Метод

Note: for "multi" mode Mongo requires explicit strategy "$set" or "$inc" to be specified for the "newData". If no strategy is passed "$set" will be used.
public update ( array $condition, array $newData, array $options = [] ) : integer | boolean
$condition array description of the objects to update.
$newData array the object with which to update the matching records.
$options array list of options in format: optionName => optionValue.
Результат integer | boolean number of updated documents or whether operation was successful.
    public function update($condition, $newData, $options = [])
    {
        $writeResult = $this->database->createCommand()->update($this->name, $condition, $newData, $options);
        return $writeResult->getModifiedCount() + $writeResult->getUpsertedCount();
    }