yii\mongodb\ActiveRecord::updateAll PHP Method

updateAll() public static method

For example, to change the status to be 1 for all customers whose status is 2: php Customer::updateAll(['status' => 1], ['status' => 2]);
public static updateAll ( array $attributes, array $condition = [], array $options = [] ) : integer
$attributes array attribute values (name-value pairs) to be saved into the collection
$condition array description of the objects to update. Please refer to [[Query::where()]] on how to specify this parameter.
$options array list of options in format: optionName => optionValue.
return integer the number of documents updated.
    public static function updateAll($attributes, $condition = [], $options = [])
    {
        return static::getCollection()->update($condition, $attributes, $options);
    }