src/Webiny/AnalyticsDb/Query/Dimensions.php
public function sortByDimensionValue($direction)
    {
        if ($this->id != '$value') {
            throw new AnalyticsDbException('In order to sort by dimension value, you need to first group by dimension value.');
        }

        $direction = (int)$direction;

        $this->pipeline['$sort'] = ['_id.value' => $direction];


        return $this;
    }
public function sortByDimensionValue($direction)
    {
        if ($this->id != '$value') {
            throw new AnalyticsDbException('In order to sort by dimension value, you need to first group by dimension value.');
        }

        $direction = (int)$direction;

        $this->pipeline['$sort'] = ['_id.value' => $direction];


        return $this;
    }
public function sortByDimensionValue ( $ direction ) { if ( $ this -> id != '$value' ) { throw new AnalyticsDbException ( 'In order to sort by dimension value, you need to first group by dimension value.' ) ; } $ direction = ( int ) $ direction ; $ this -> pipeline [ '$sort' ] = [ '_id.value' => $ direction ] ; return $ this ; }
Sort records by dimension value.

@param string $direction Mongo sort direction: 1 => ascending; -1 => descending

@return $this
@throws AnalyticsDbException
Sort records by dimension value .