This repository was archived by the owner on May 8, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
google-cloud-firestore/src/main/java/com/google/cloud/firestore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,15 +174,19 @@ static BooleanExpression toPipelineBooleanExpr(FilterInternal f) {
174174 static AliasedAggregate toPipelineAggregatorTarget (AggregateField f ) {
175175 String operator = f .getOperator ();
176176 String fieldPath = f .getFieldPath ();
177+ String alias = f .getAlias ();
178+ if (alias .contains ("." )) {
179+ alias = "`" + alias + "`" ;
180+ }
177181
178182 switch (operator ) {
179183 case "sum" :
180- return Field .ofServerPath (fieldPath ).sum ().as (f . getAlias () );
184+ return Field .ofServerPath (fieldPath ).sum ().as (alias );
181185
182186 case "count" :
183- return countAll ().as (f . getAlias () );
187+ return countAll ().as (alias );
184188 case "average" :
185- return Field .ofServerPath (fieldPath ).average ().as (f . getAlias () );
189+ return Field .ofServerPath (fieldPath ).average ().as (alias );
186190 default :
187191 // Handle the 'else' case appropriately in your Java code
188192 throw new IllegalArgumentException ("Unsupported operator: " + operator );
You can’t perform that action at this time.
0 commit comments