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

Commit 46ed5ab

Browse files
chore: generate libraries at Tue Feb 24 21:31:55 UTC 2026
1 parent 49183e0 commit 46ed5ab

2 files changed

Lines changed: 447 additions & 368 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:

0 commit comments

Comments
 (0)