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

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

Note: for "multiple" 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 | string $collection, array $condition, array $newData, array $options = [] ) : integer | boolean
$collection array | string collection name.
$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($collection, $condition, $newData, $options = [])
    {
        $this->beginProfile($token = "    > update " . $this->composeCollectionLogName($collection) . ") ...");
        $result = $this->db->getCollection($collection)->update($condition, $newData, $options);
        $this->endProfile($token);
        return $result;
    }