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

Commit d504667

Browse files
chore: generate libraries at Wed Feb 25 22:09:45 UTC 2026
1 parent 7acdb11 commit d504667

7 files changed

Lines changed: 463 additions & 706 deletions

File tree

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

Lines changed: 23 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,18 @@ public static Pipeline subcollection(String path) {
275275
}
276276

277277
/**
278-
* Defines one or more variables in the pipeline's scope. `define` is used to
279-
* bind a value to a
278+
* Defines one or more variables in the pipeline's scope. `define` is used to bind a value to a
280279
* variable for internal reuse within the pipeline body (accessed via the {@link
281280
* Expression#variable(String)} function).
282281
*
283-
* <p>
284-
* This stage is useful for declaring reusable values or intermediate
285-
* calculations that can be
286-
* referenced multiple times in later parts of the pipeline, improving
287-
* readability and maintainability.
282+
* <p>This stage is useful for declaring reusable values or intermediate calculations that can be
283+
* referenced multiple times in later parts of the pipeline, improving readability and
284+
* maintainability.
288285
*
289-
* <p>
290-
* Each variable is defined using an {@link AliasedExpression}, which pairs an
291-
* expression with a name (alias).
286+
* <p>Each variable is defined using an {@link AliasedExpression}, which pairs an expression with
287+
* a name (alias).
292288
*
293-
* <p>
294-
* Example:
289+
* <p>Example:
295290
*
296291
* <pre>{@code
297292
* firestore.pipeline().collection("products")
@@ -302,10 +297,8 @@ public static Pipeline subcollection(String path) {
302297
* .select(field("name"), variable("newStock"));
303298
* }</pre>
304299
*
305-
* @param expression The expression to define using
306-
* {@link AliasedExpression}.
307-
* @param additionalExpressions Additional expressions to define using
308-
* {@link AliasedExpression}.
300+
* @param expression The expression to define using {@link AliasedExpression}.
301+
* @param additionalExpressions Additional expressions to define using {@link AliasedExpression}.
309302
* @return A new Pipeline object with this stage appended to the stage list.
310303
*/
311304
@BetaApi
@@ -331,28 +324,19 @@ public Expression toArrayExpression() {
331324
}
332325

333326
/**
334-
* Converts this Pipeline into an expression that evaluates to a single scalar
335-
* result. Used for
336-
* 1:1 lookups or Aggregations when the subquery is expected to return a single
337-
* value or object.
338-
*
339-
* <p>
340-
* <b>Runtime Validation:</b> The runtime will validate that the result set
341-
* contains exactly
342-
* one item. It throws a runtime error if the result has more than one item, and
343-
* evaluates to
327+
* Converts this Pipeline into an expression that evaluates to a single scalar result. Used for
328+
* 1:1 lookups or Aggregations when the subquery is expected to return a single value or object.
329+
*
330+
* <p><b>Runtime Validation:</b> The runtime will validate that the result set contains exactly
331+
* one item. It throws a runtime error if the result has more than one item, and evaluates to
344332
* {@code null} if the pipeline has zero results.
345333
*
346-
* <p>
347-
* <b>Result Unwrapping:</b> For simpler access, scalar subqueries producing a
348-
* single field
349-
* automatically unwrap that value to the top level, ignoring the inner alias.
350-
* If the subquery
334+
* <p><b>Result Unwrapping:</b> For simpler access, scalar subqueries producing a single field
335+
* automatically unwrap that value to the top level, ignoring the inner alias. If the subquery
351336
* returns multiple fields, they are preserved as a map.
352337
*
353-
* <p>
354-
* <b>Example 1: Single field unwrapping</b>
355-
*
338+
* <p><b>Example 1: Single field unwrapping</b>
339+
*
356340
* <pre>{@code
357341
* // Calculate average rating for each restaurant using a subquery
358342
* db.pipeline().collection("restaurants")
@@ -367,11 +351,8 @@ public Expression toArrayExpression() {
367351
* .as("average_rating"))
368352
* }</pre>
369353
*
370-
* <p>
371-
* <i>The result set is unwrapped twice: from {@code "average_rating": [{
372-
* "value": 4.5 }]}
373-
* to {@code "average_rating": { "value": 4.5 }}, and finally to
374-
* {@code "average_rating": 4.5}.</i>
354+
* <p><i>The result set is unwrapped twice: from {@code "average_rating": [{ "value": 4.5 }]} to
355+
* {@code "average_rating": { "value": 4.5 }}, and finally to {@code "average_rating": 4.5}.</i>
375356
*
376357
* <pre>{@code
377358
* // Output Document:
@@ -391,9 +372,8 @@ public Expression toArrayExpression() {
391372
* ]
392373
* }</pre>
393374
*
394-
* <p>
395-
* <b>Example 2: Multiple fields (Map)</b>
396-
*
375+
* <p><b>Example 2: Multiple fields (Map)</b>
376+
*
397377
* <pre>{@code
398378
* // For each restaurant, calculate review statistics (average rating AND total
399379
* // count)
@@ -409,8 +389,7 @@ public Expression toArrayExpression() {
409389
* .as("stats"))
410390
* }</pre>
411391
*
412-
* <p>
413-
* <i>When the subquery produces multiple fields, they are wrapped in a map:</i>
392+
* <p><i>When the subquery produces multiple fields, they are wrapped in a map:</i>
414393
*
415394
* <pre>{@code
416395
* // Output Document:

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

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ public static Field field(FieldPath fieldPath) {
218218
return Field.ofUserPath(fieldPath.toString());
219219
}
220220

221-
222221
/**
223222
* Creates an expression that returns the current timestamp.
224223
*
@@ -229,7 +228,6 @@ public static Expression currentTimestamp() {
229228
return new FunctionExpression("current_timestamp", ImmutableList.of());
230229
}
231230

232-
233231
/**
234232
* Creates an expression that returns a default value if an expression evaluates to an absent
235233
* value.
@@ -4834,8 +4832,7 @@ public static Expression pipeline(Pipeline pipeline) {
48344832
}
48354833

48364834
/**
4837-
* Accesses a field/property of the expression (useful when the expression
4838-
* evaluates to a Map or
4835+
* Accesses a field/property of the expression (useful when the expression evaluates to a Map or
48394836
* Document).
48404837
*
48414838
* @param key The key of the field to access.
@@ -4847,8 +4844,7 @@ public Expression getField(String key) {
48474844
}
48484845

48494846
/**
4850-
* Retrieves the value of a specific field from the document evaluated by this
4851-
* expression.
4847+
* Retrieves the value of a specific field from the document evaluated by this expression.
48524848
*
48534849
* @param keyExpression The expression evaluating to the key to access.
48544850
* @return A new {@link Expression} representing the field value.
@@ -4862,7 +4858,7 @@ public Expression getField(Expression keyExpression) {
48624858
* Accesses a field/property of a document field using the provided {@code key}.
48634859
*
48644860
* @param fieldName The field name of the map or document field.
4865-
* @param key The key of the field to access.
4861+
* @param key The key of the field to access.
48664862
* @return An {@link Expression} representing the value of the field.
48674863
*/
48684864
@BetaApi
@@ -4871,10 +4867,9 @@ public static Expression getField(String fieldName, String key) {
48714867
}
48724868

48734869
/**
4874-
* Accesses a field/property of the expression using the provided
4875-
* {@code keyExpression}.
4870+
* Accesses a field/property of the expression using the provided {@code keyExpression}.
48764871
*
4877-
* @param expression The expression evaluating to a Map or Document.
4872+
* @param expression The expression evaluating to a Map or Document.
48784873
* @param keyExpression The expression evaluating to the key.
48794874
* @return A new {@link Expression} representing the value of the field.
48804875
*/
@@ -4884,10 +4879,9 @@ public static Expression getField(Expression expression, Expression keyExpressio
48844879
}
48854880

48864881
/**
4887-
* Accesses a field/property of a document field using the provided
4888-
* {@code keyExpression}.
4882+
* Accesses a field/property of a document field using the provided {@code keyExpression}.
48894883
*
4890-
* @param fieldName The field name of the map or document field.
4884+
* @param fieldName The field name of the map or document field.
48914885
* @param keyExpression The expression evaluating to the key.
48924886
* @return A new {@link Expression} representing the value of the field.
48934887
*/
@@ -4897,11 +4891,11 @@ public static Expression getField(String fieldName, Expression keyExpression) {
48974891
}
48984892

48994893
/**
4900-
* Accesses a field/property of the expression (useful when the expression
4901-
* evaluates to a Map or Document).
4894+
* Accesses a field/property of the expression (useful when the expression evaluates to a Map or
4895+
* Document).
49024896
*
49034897
* @param expression The expression evaluating to a map/document.
4904-
* @param key The key of the field to access.
4898+
* @param key The key of the field to access.
49054899
* @return An {@link Expression} representing the value of the field.
49064900
*/
49074901
@BetaApi
@@ -4912,8 +4906,7 @@ public static Expression getField(Expression expression, String key) {
49124906
/**
49134907
* Internal expression representing a variable reference.
49144908
*
4915-
* <p>
4916-
* This evaluates to the value of a variable defined in a pipeline context.
4909+
* <p>This evaluates to the value of a variable defined in a pipeline context.
49174910
*/
49184911
static class Variable extends Expression {
49194912
private final String name;
@@ -4928,9 +4921,7 @@ public Value toProto() {
49284921
}
49294922
}
49304923

4931-
/**
4932-
* Internal expression representing a pipeline value.
4933-
*/
4924+
/** Internal expression representing a pipeline value. */
49344925
static class PipelineValueExpression extends Expression {
49354926
private final Pipeline pipeline;
49364927

@@ -4943,5 +4934,4 @@ public Value toProto() {
49434934
return pipeline.toProtoValue();
49444935
}
49454936
}
4946-
49474937
}

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/DefineStage.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public DefineStage(Map<String, Expression> expressions) {
3939
Iterable<Value> toStageArgs() {
4040
java.util.Map<String, Value> converted = new java.util.HashMap<>();
4141
for (Map.Entry<String, Expression> entry : expressions.entrySet()) {
42-
converted.put(entry.getKey(), com.google.cloud.firestore.pipeline.expressions.FunctionUtils.exprToValue(entry.getValue()));
42+
converted.put(
43+
entry.getKey(),
44+
com.google.cloud.firestore.pipeline.expressions.FunctionUtils.exprToValue(
45+
entry.getValue()));
4346
}
4447
return Collections.singletonList(encodeValue(converted));
4548
}

0 commit comments

Comments
 (0)