yii\mongodb\ActiveRecord::updateAllCounters PHP Метод

updateAllCounters() публичный статический Метод

For example, to increment all customers' age by 1, php Customer::updateAllCounters(['age' => 1]);
public static updateAllCounters ( array $counters, array $condition = [], array $options = [] ) : integer
$counters array the counters to be updated (attribute name => increment value). Use negative values if you want to decrement the counters.
$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.
Результат integer the number of documents updated.
    public static function updateAllCounters($counters, $condition = [], $options = [])
    {
        return static::getCollection()->update($condition, ['$inc' => $counters], $options);
    }