yii\mongodb\Query::average PHP Метод

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

Returns the average of the specified column values.
public average ( string $q, Connection $db = null ) : integer
$q string the column name. Make sure you properly quote column names in the expression.
$db Connection the Mongo connection used to execute the query. If this parameter is not given, the `mongodb` application component will be used.
Результат integer the average of the specified column values.
    public function average($q, $db = null)
    {
        return $this->aggregate($q, 'avg', $db);
    }