Doctrine\MongoDB\Aggregation\Stage\Group::getExpression PHP Method

getExpression() public method

public getExpression ( )
    public function getExpression()
    {
        return ['$group' => $this->expr->getExpression()];
    }

Usage Example

Beispiel #1
0
 public function testGroupWithOperatorInId()
 {
     $groupStage = new Group($this->getTestAggregationBuilder());
     $groupStage->field('_id')->year('$dateField')->field('count')->sum(1);
     $this->assertSame(['$group' => ['_id' => ['$year' => '$dateField'], 'count' => ['$sum' => 1]]], $groupStage->getExpression());
 }
All Usage Examples Of Doctrine\MongoDB\Aggregation\Stage\Group::getExpression