Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit ed82cd4

Browse files
committed
change syntax for define and return type of as function
1 parent 097cdd5 commit ed82cd4

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,22 @@ public static Pipeline subcollection(String path) {
283283
* within the pipeline
284284
* body (accessed via the {@link Expression#variable(String)} function).
285285
*
286-
* @param expressions The expressions to define or redefine fields using
287-
* {@link AliasedExpression}.
286+
* @param expression The expression to define using
287+
* {@link AliasedExpression}.
288+
* @param additionalExpressions Additional expressions to define using
289+
* {@link AliasedExpression}.
288290
* @return A new Pipeline object with this stage appended to the stage list.
289291
*/
290292
@BetaApi
291-
public Pipeline define(Selectable... expressions) {
293+
public Pipeline define(AliasedExpression expression, AliasedExpression... additionalExpressions) {
292294
return append(
293-
new DefineStage(PipelineUtils.selectablesToMap(expressions)));
295+
new DefineStage(
296+
PipelineUtils.selectablesToMap(
297+
ImmutableList.<AliasedExpression>builder()
298+
.add(expression)
299+
.add(additionalExpressions)
300+
.build()
301+
.toArray(new AliasedExpression[0]))));
294302
}
295303

296304
/**

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ public final Ordering descending() {
43384338
* expression and associates it with the provided alias.
43394339
*/
43404340
@BetaApi
4341-
public Selectable as(String alias) {
4341+
public AliasedExpression as(String alias) {
43424342
return new AliasedExpression(this, alias);
43434343
}
43444344

0 commit comments

Comments
 (0)