Doctrine\MongoDB\Aggregation\Stage\Group::field PHP Метод

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

Set the current field for building the expression.
См. также: Expr::field
public field ( string $fieldName )
$fieldName string
    public function field($fieldName)
    {
        $this->expr->field($fieldName);
        return $this;
    }

Usage Example

Пример #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::field