enableIndexedDbPersistence() will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the code on the error.\* failed-precondition: The app is already open in another browser tab. \* unimplemented: The browser is incompatible with the offline persistence implementation.Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled.Note: enableIndexedDbPersistence() must be called before any other functions (other than [initializeFirestore()](./firestore_.md#initializefirestore_fc7d200), [getFirestore()](./firestore_.md#getfirestore) or [clearIndexedDbPersistence()](./firestore_.md#clearindexeddbpersistence_231a8e0).Persistence cannot be used in a Node.js environment. |
| [enableMultiTabIndexedDbPersistence(firestore)](./firestore_.md#enablemultitabindexeddbpersistence_231a8e0) | Attempts to enable multi-tab persistent storage, if possible. If enabled across all tabs, all operations share access to local persistence, including shared execution of queries and latency-compensated local document updates across all connected instances.On failure, enableMultiTabIndexedDbPersistence() will reject the promise or throw an exception. There are several reasons why this can fail, which can be identified by the code on the error.\* failed-precondition: The app is already open in another browser tab and multi-tab is not enabled. \* unimplemented: The browser is incompatible with the offline persistence implementation.Note that even after a failure, the [Firestore](./firestore_.firestore.md#firestore_class) instance will remain usable, however offline persistence will be disabled. |
| [enableNetwork(firestore)](./firestore_.md#enablenetwork_231a8e0) | Re-enables use of the network for this [Firestore](./firestore_.firestore.md#firestore_class) instance after a prior call to [disableNetwork()](./firestore_.md#disablenetwork_231a8e0). |
-| [getPersistentCacheIndexManager(firestore)](./firestore_.md#getpersistentcacheindexmanager_231a8e0) | Returns the PersistentCache Index Manager used by the given Firestore object. The PersistentCacheIndexManager instance, or null if local persistent storage is not in use. |
+| [getPersistentCacheIndexManager(firestore)](./firestore_.md#getpersistentcacheindexmanager_231a8e0) | Returns the PersistentCache Index Manager used by the given Firestore object. |
| [loadBundle(firestore, bundleData)](./firestore_.md#loadbundle_bec5b75) | Loads a Firestore bundle into the local cache. |
| [namedQuery(firestore, name)](./firestore_.md#namedquery_6438876) | Reads a Firestore [Query](./firestore_.query.md#query_class) from local cache, identified by the given name.The named queries are packaged into bundles on the server side (along with resulting documents), and loaded to local cache using loadBundle. Once in local cache, use this method to extract a [Query](./firestore_.query.md#query_class) by name. |
| [onSnapshotResume(firestore, snapshotJson, onNext, onError, onCompletion, converter)](./firestore_.md#onsnapshotresume_7c84f5e) | Attaches a listener for QuerySnapshot events based on data generated by invoking [QuerySnapshot.toJSON()](./firestore_.querysnapshot.md#querysnapshottojson) You may either pass individual onNext and onError callbacks or pass a single observer object with next and error callbacks. The listener can be cancelled by calling the function that is returned when onSnapshot is called.NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending. |
@@ -170,7 +170,7 @@ https://github.com/firebase/firebase-js-sdk
| [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. |
| [Timestamp](./firestore_.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). |
| [Transaction](./firestore_.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). |
-| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue |
+| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). |
| [WriteBatch](./firestore_.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. |
## Interfaces
@@ -660,8 +660,6 @@ A `Promise` that is resolved once the network has been enabled.
Returns the PersistentCache Index Manager used by the given `Firestore` object.
- The `PersistentCacheIndexManager` instance, or `null` if local persistent storage is not in use.
-
Signature:
```typescript
@@ -678,6 +676,8 @@ export declare function getPersistentCacheIndexManager(firestore: Firestore): Pe
[PersistentCacheIndexManager](./firestore_.persistentcacheindexmanager.md#persistentcacheindexmanager_class) \| null
+The `PersistentCacheIndexManager` instance, or `null` if local persistent storage is not in use.
+
### loadBundle(firestore, bundleData) {:#loadbundle_bec5b75}
Loads a Firestore bundle into the local cache.
diff --git a/docs-devsite/firestore_.vectorvalue.md b/docs-devsite/firestore_.vectorvalue.md
index 1fc4e2b35a..fe03c3a690 100644
--- a/docs-devsite/firestore_.vectorvalue.md
+++ b/docs-devsite/firestore_.vectorvalue.md
@@ -12,8 +12,6 @@ https://github.com/firebase/firebase-js-sdk
# VectorValue class
Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2).
- VectorValue
-
Signature:
```typescript
diff --git a/docs-devsite/firestore_lite.md b/docs-devsite/firestore_lite.md
index 20fafd66c5..1a2ca88300 100644
--- a/docs-devsite/firestore_lite.md
+++ b/docs-devsite/firestore_lite.md
@@ -119,7 +119,7 @@ https://github.com/firebase/firebase-js-sdk
| [QueryStartAtConstraint](./firestore_lite.querystartatconstraint.md#querystartatconstraint_class) | A QueryStartAtConstraint is used to exclude documents from the start of a result set returned by a Firestore query. QueryStartAtConstraints are created by invoking [startAt()](./firestore_.md#startat_9a4477f) or [startAfter()](./firestore_.md#startafter_9a4477f) and can then be passed to [query()](./firestore_.md#query_9f7b0f4) to create a new query instance that also contains this QueryStartAtConstraint. |
| [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). |
| [Transaction](./firestore_lite.transaction.md#transaction_class) | A reference to a transaction.The Transaction object passed to a transaction's updateFunction provides the methods to read and write data within the transaction context. See [runTransaction()](./firestore_.md#runtransaction_6f03ec4). |
-| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue |
+| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). |
| [WriteBatch](./firestore_lite.writebatch.md#writebatch_class) | A write batch, used to perform multiple writes as a single atomic unit.A WriteBatch object can be acquired by calling [writeBatch()](./firestore_.md#writebatch_231a8e0). It provides methods for adding writes to the write batch. None of the writes will be committed (or visible locally) until [WriteBatch.commit()](./firestore_.writebatch.md#writebatchcommit) is called. |
## Interfaces
diff --git a/docs-devsite/firestore_lite.vectorvalue.md b/docs-devsite/firestore_lite.vectorvalue.md
index 17c18e4c4e..4b675d4c94 100644
--- a/docs-devsite/firestore_lite.vectorvalue.md
+++ b/docs-devsite/firestore_lite.vectorvalue.md
@@ -12,8 +12,6 @@ https://github.com/firebase/firebase-js-sdk
# VectorValue class
Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2).
- VectorValue
-
Signature:
```typescript
diff --git a/docs-devsite/firestore_lite_pipelines.aggregatefunction.md b/docs-devsite/firestore_lite_pipelines.aggregatefunction.md
index 17925a6144..fe3dfc3b93 100644
--- a/docs-devsite/firestore_lite_pipelines.aggregatefunction.md
+++ b/docs-devsite/firestore_lite_pipelines.aggregatefunction.md
@@ -37,14 +37,7 @@ export declare class AggregateFunction
| Method | Modifiers | Description |
| --- | --- | --- |
-| [as(name)](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunctionas) | | (Public Preview) Assigns an alias to this AggregateFunction. The alias specifies the name that the aggregated value will have in the output document.
-```typescript
-// Calculate the average price of all items and assign it the alias "averagePrice".
-firestore.pipeline().collection("items")
- .aggregate(field("price").average().as("averagePrice"));
-
-```
- |
+| [as(name)](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunctionas) | | (Public Preview) Assigns an alias to this AggregateFunction. The alias specifies the name that the aggregated value will have in the output document. |
## AggregateFunction.(constructor)
@@ -84,13 +77,6 @@ exprType: ExpressionType;
Assigns an alias to this AggregateFunction. The alias specifies the name that the aggregated value will have in the output document.
-```typescript
-// Calculate the average price of all items and assign it the alias "averagePrice".
-firestore.pipeline().collection("items")
- .aggregate(field("price").average().as("averagePrice"));
-
-```
-
Signature:
```typescript
@@ -101,9 +87,21 @@ as(name: string): AliasedAggregate;
| Parameter | Type | Description |
| --- | --- | --- |
-| name | string | The alias to assign to this AggregateFunction. A new that wraps this AggregateFunction and associates it with the provided alias. |
+| name | string | The alias to assign to this AggregateFunction. |
Returns:
[AliasedAggregate](./firestore_lite_pipelines.aliasedaggregate.md#aliasedaggregate_class)
+A new [AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class) that wraps this AggregateFunction and associates it with the provided alias.
+
+### Example
+
+
+```typescript
+// Calculate the average price of all items and assign it the alias "averagePrice".
+firestore.pipeline().collection("items")
+ .aggregate(field("price").average().as("averagePrice"));
+
+```
+
diff --git a/docs-devsite/firestore_lite_pipelines.booleanexpression.md b/docs-devsite/firestore_lite_pipelines.booleanexpression.md
index f77b0e503d..f970712c06 100644
--- a/docs-devsite/firestore_lite_pipelines.booleanexpression.md
+++ b/docs-devsite/firestore_lite_pipelines.booleanexpression.md
@@ -26,57 +26,13 @@ export declare abstract class BooleanExpression extends Expression
| Method | Modifiers | Description |
| --- | --- | --- |
-| [conditional(thenExpr, elseExpr)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressionconditional) | | (Public Preview) Creates a conditional expression that evaluates to the 'then' expression if this expression evaluates to true, or evaluates to the 'else' expression if this expressions evaluates false.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
-
-```
- |
-| [countIf()](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioncountif) | | (Public Preview) Creates an aggregation that finds the count of input documents satisfying this boolean expression.
-```typescript
-// Find the count of documents with a score greater than 90
-field("score").greaterThan(90).countIf().as("highestScore");
-
-```
- A new AggregateFunction representing the 'countIf' aggregation. |
-| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(constant(false));
-
-```
- |
-| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(false);
-
-```
- |
-| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(constant(0));
-
-```
- |
-| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(0);
-
-```
- |
-| [not()](./firestore_lite_pipelines.booleanexpression.md#booleanexpressionnot) | | (Public Preview) Creates an expression that negates this boolean expression.
-```typescript
-// Find documents where the 'tags' field does not contain 'completed'
-field("tags").arrayContains("completed").not();
-
-```
- A new representing the negated filter condition. |
+| [conditional(thenExpr, elseExpr)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressionconditional) | | (Public Preview) Creates a conditional expression that evaluates to the 'then' expression if this expression evaluates to true, or evaluates to the 'else' expression if this expressions evaluates false. |
+| [countIf()](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioncountif) | | (Public Preview) Creates an aggregation that finds the count of input documents satisfying this boolean expression. |
+| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_lite_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [not()](./firestore_lite_pipelines.booleanexpression.md#booleanexpressionnot) | | (Public Preview) Creates an expression that negates this boolean expression. |
## BooleanExpression.conditional()
@@ -85,12 +41,6 @@ field("tags").arrayContains("completed").not();
Creates a conditional expression that evaluates to the 'then' expression if `this` expression evaluates to `true`, or evaluates to the 'else' expression if `this` expressions evaluates `false`.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
-
-```
-
Signature:
```typescript
@@ -102,25 +52,29 @@ conditional(thenExpr: Expression, elseExpr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| thenExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is true. |
-| elseExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. |
+| elseExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## BooleanExpression.countIf()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the conditional expression.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that finds the count of input documents satisfying this boolean expression.
```typescript
-// Find the count of documents with a score greater than 90
-field("score").greaterThan(90).countIf().as("highestScore");
+// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
+field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
```
- A new `AggregateFunction` representing the 'countIf' aggregation.
+
+## BooleanExpression.countIf()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that finds the count of input documents satisfying this boolean expression.
Signature:
@@ -131,20 +85,24 @@ countIf(): AggregateFunction;
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-## BooleanExpression.ifError()
+A new `AggregateFunction` representing the 'countIf' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(constant(false));
+// Find the count of documents with a score greater than 90
+field("score").greaterThan(90).countIf().as("highestScore");
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -155,26 +113,31 @@ ifError(catchValue: BooleanExpression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The value that will be returned if this expression produces an error. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## BooleanExpression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
// Create an expression that protects against a divide by zero error
// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(false);
+constant(50).divide('length').gt(1).ifError(constant(false));
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -185,25 +148,31 @@ ifError(catchValue: boolean): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | boolean | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | boolean | The value that will be returned if this expression produces an error. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## BooleanExpression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
-// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(constant(0));
+// Create an expression that protects against a divide by zero error
+// but always returns a boolean expression.
+constant(50).divide('length').gt(1).ifError(false);
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -214,25 +183,30 @@ ifError(catchValue: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The value that will be returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## BooleanExpression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(0);
+constant(50).divide('length').gt(1).ifError(constant(0));
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -243,25 +217,29 @@ ifError(catchValue: unknown): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | unknown | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | unknown | The value that will be returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## BooleanExpression.not()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that negates this boolean expression.
```typescript
-// Find documents where the 'tags' field does not contain 'completed'
-field("tags").arrayContains("completed").not();
+// Create an expression that protects against a divide by zero error.
+constant(50).divide('length').gt(1).ifError(0);
```
- A new representing the negated filter condition.
+
+## BooleanExpression.not()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that negates this boolean expression.
Signature:
@@ -272,3 +250,14 @@ not(): BooleanExpression;
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the negated filter condition.
+
+### Example
+
+
+```typescript
+// Find documents where the 'tags' field does not contain 'completed'
+field("tags").arrayContains("completed").not();
+
+```
+
diff --git a/docs-devsite/firestore_lite_pipelines.expression.md b/docs-devsite/firestore_lite_pipelines.expression.md
index fbaba7d825..b8790f8879 100644
--- a/docs-devsite/firestore_lite_pipelines.expression.md
+++ b/docs-devsite/firestore_lite_pipelines.expression.md
@@ -13,13 +13,13 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Represents an expression that can be evaluated to a value within the execution of a .
+Represents an expression that can be evaluated to a value within the execution of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).
Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:
- \*\*Field references:\*\* Access values from document fields. - \*\*Literals:\*\* Represent constant values (strings, numbers, booleans). - \*\*Function calls:\*\* Apply functions to one or more expressions.
-The `Expr` class provides a fluent API for building expressions. You can chain together method calls to create complex expressions.
+The `Expression` class provides a fluent API for building expressions. You can chain together method calls to create complex expressions.
Signature:
@@ -37,821 +37,134 @@ export declare abstract class Expression
| Method | Modifiers | Description |
| --- | --- | --- |
-| [abs()](./firestore_lite_pipelines.expression.md#expressionabs) | | (Public Preview) Creates an expression that computes the absolute value of a numeric value.
-```typescript
-// Compute the absolute value of the 'price' field.
-field("price").abs();
-
-```
- A new representing the absolute value of the numeric value. |
-| [add(second)](./firestore_lite_pipelines.expression.md#expressionadd) | | (Public Preview) Creates an expression that adds this expression to another expression.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-field("quantity").add(field("reserve"));
-
-```
- |
-| [arrayConcat(secondArray, otherArrays)](./firestore_lite_pipelines.expression.md#expressionarrayconcat) | | (Public Preview) Creates an expression that concatenates an array expression with one or more other arrays.
-```typescript
-// Combine the 'items' array with another array field.
-field("items").arrayConcat(field("otherItems"));
-
-```
- |
-| [arrayContains(expression)](./firestore_lite_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific element.
-```typescript
-// Check if the 'sizes' array contains the value from the 'selectedSize' field
-field("sizes").arrayContains(field("selectedSize"));
-
-```
- |
-| [arrayContains(value)](./firestore_lite_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific value.
-```typescript
-// Check if the 'colors' array contains "red"
-field("colors").arrayContains("red");
-
-```
- |
-| [arrayContainsAll(values)](./firestore_lite_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements.
-```typescript
-// Check if the 'tags' array contains both the value in field "tag1" and the literal value "tag2"
-field("tags").arrayContainsAll([field("tag1"), "tag2"]);
-
-```
- |
-| [arrayContainsAll(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements.
-```typescript
-// Check if the 'tags' array contains both of the values from field "tag1" and the literal value "tag2"
-field("tags").arrayContainsAll(array([field("tag1"), "tag2"]));
-
-```
- |
-| [arrayContainsAny(values)](./firestore_lite_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements.
-```typescript
-// Check if the 'categories' array contains either values from field "cate1" or "cate2"
-field("categories").arrayContainsAny([field("cate1"), field("cate2")]);
-
-```
- |
-| [arrayContainsAny(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements.
-```typescript
-// Check if the 'groups' array contains either the value from the 'userGroup' field
-// or the value "guest"
-field("groups").arrayContainsAny(array([field("userGroup"), "guest"]));
-
-```
- |
-| [arrayGet(offset)](./firestore_lite_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the 'tags' field array at index `1`.
-field('tags').arrayGet(1);
-
-```
- |
-| [arrayGet(offsetExpr)](./firestore_lite_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-field('tags').arrayGet(field('favoriteTag'));
-
-```
- |
-| [arrayLength()](./firestore_lite_pipelines.expression.md#expressionarraylength) | | (Public Preview) Creates an expression that calculates the length of an array.
-```typescript
-// Get the number of items in the 'cart' array
-field("cart").arrayLength();
-
-```
- A new Expr representing the length of the array. |
-| [arrayReverse()](./firestore_lite_pipelines.expression.md#expressionarrayreverse) | | (Public Preview) Creates an expression that reverses an array.
-```typescript
-// Reverse the value of the 'myArray' field.
-field("myArray").arrayReverse();
-
-```
- A new representing the reversed array. |
-| [arraySum()](./firestore_lite_pipelines.expression.md#expressionarraysum) | | (Public Preview) Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-field("scores").arraySum();
-
-```
- A new representing the sum of the elements in the array. |
-| [as(name)](./firestore_lite_pipelines.expression.md#expressionas) | | (Public Preview) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values.
-```typescript
-// Calculate the total price and assign it the alias "totalPrice" and add it to the output.
-firestore.pipeline().collection("items")
- .addFields(field("price").multiply(field("quantity")).as("totalPrice"));
-
-```
- |
-| [asBoolean()](./firestore_lite_pipelines.expression.md#expressionasboolean) | | (Public Preview) Wraps the expression in a \[BooleanExpression\]. A \[BooleanExpression\] representing the same expression. |
-| [ascending()](./firestore_lite_pipelines.expression.md#expressionascending) | | (Public Preview) Creates an that sorts documents in ascending order based on this expression.
-```typescript
-// Sort documents by the 'name' field in ascending order
-pipeline().collection("users")
- .sort(field("name").ascending());
-
-```
- A new Ordering for ascending sorting. |
-| [average()](./firestore_lite_pipelines.expression.md#expressionaverage) | | (Public Preview) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs.
-```typescript
-// Calculate the average age of users
-field("age").average().as("averageAge");
-
-```
- A new AggregateFunction representing the 'average' aggregation. |
-| [byteLength()](./firestore_lite_pipelines.expression.md#expressionbytelength) | | (Public Preview) Creates an expression that calculates the length of this string expression in bytes.
-```typescript
-// Calculate the length of the 'myString' field in bytes.
-field("myString").byteLength();
-
-```
- A new representing the length of the string in bytes. |
-| [ceil()](./firestore_lite_pipelines.expression.md#expressionceil) | | (Public Preview) Creates an expression that computes the ceiling of a numeric value.
-```typescript
-// Compute the ceiling of the 'price' field.
-field("price").ceil();
-
-```
- A new representing the ceiling of the numeric value. |
-| [charLength()](./firestore_lite_pipelines.expression.md#expressioncharlength) | | (Public Preview) Creates an expression that calculates the character length of a string in UTF-8.
-```typescript
-// Get the character length of the 'name' field in its UTF-8 form.
-field("name").charLength();
-
-```
- A new Expr representing the length of the string. |
-| [collectionId()](./firestore_lite_pipelines.expression.md#expressioncollectionid) | | (Public Preview) Creates an expression that returns the collection ID from a path.
-```typescript
-// Get the collection ID from a path.
-field("__path__").collectionId();
-
-```
- A new representing the collectionId operation. |
-| [concat(second, others)](./firestore_lite_pipelines.expression.md#expressionconcat) | | (Public Preview) Creates an expression that concatenates expression results together.
-```typescript
-// Combine the 'firstName', ' ', and 'lastName' fields into a single value.
-field("firstName").concat(constant(" "), field("lastName"));
-
-```
- |
-| [cosineDistance(vectorExpression)](./firestore_lite_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the cosine distance between two vectors.
-```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-field("userVector").cosineDistance(field("itemVector"));
-
-```
- |
-| [cosineDistance(vector)](./firestore_lite_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the Cosine distance between two vectors.
-```typescript
-// Calculate the Cosine distance between the 'location' field and a target location
-field("location").cosineDistance(new VectorValue([37.7749, -122.4194]));
-
-```
- |
-| [count()](./firestore_lite_pipelines.expression.md#expressioncount) | | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field.
-```typescript
-// Count the total number of products
-field("productId").count().as("totalProducts");
-
-```
- A new AggregateFunction representing the 'count' aggregation. |
-| [countDistinct()](./firestore_lite_pipelines.expression.md#expressioncountdistinct) | | (Public Preview) Creates an aggregation that counts the number of distinct values of the expression or field.
-```typescript
-// Count the distinct number of products
-field("productId").countDistinct().as("distinctProducts");
-
-```
- A new AggregateFunction representing the 'count\_distinct' aggregation. |
-| [descending()](./firestore_lite_pipelines.expression.md#expressiondescending) | | (Public Preview) Creates an that sorts documents in descending order based on this expression.
-```typescript
-// Sort documents by the 'createdAt' field in descending order
-firestore.pipeline().collection("users")
- .sort(field("createdAt").descending());
-
-```
- A new Ordering for descending sorting. |
-| [divide(divisor)](./firestore_lite_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by another expression.
-```typescript
-// Divide the 'total' field by the 'count' field
-field("total").divide(field("count"));
-
-```
- |
-| [divide(divisor)](./firestore_lite_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by a constant value.
-```typescript
-// Divide the 'value' field by 10
-field("value").divide(10);
-
-```
- |
-| [documentId()](./firestore_lite_pipelines.expression.md#expressiondocumentid) | | (Public Preview) Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-field("__path__").documentId();
-
-```
- A new representing the documentId operation. |
-| [dotProduct(vectorExpression)](./firestore_lite_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors.
-```typescript
-// Calculate the dot product between a feature vector and a target vector
-field("features").dotProduct([0.5, 0.8, 0.2]);
-
-```
- |
-| [dotProduct(vector)](./firestore_lite_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors.
-```typescript
-// Calculate the dot product between a feature vector and a target vector
-field("features").dotProduct(new VectorValue([0.5, 0.8, 0.2]));
-
-```
- |
-| [endsWith(suffix)](./firestore_lite_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix.
-```typescript
-// Check if the 'filename' field ends with ".txt"
-field("filename").endsWith(".txt");
-
-```
- |
-| [endsWith(suffix)](./firestore_lite_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix (represented as an expression).
-```typescript
-// Check if the 'url' field ends with the value of the 'extension' field
-field("url").endsWith(field("extension"));
-
-```
- |
-| [equal(expression)](./firestore_lite_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to another expression.
-```typescript
-// Check if the 'age' field is equal to 21
-field("age").equal(21);
-
-```
- |
-| [equal(value)](./firestore_lite_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to a constant value.
-```typescript
-// Check if the 'city' field is equal to "London"
-field("city").equal("London");
-
-```
- |
-| [equalAny(values)](./firestore_lite_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-field("category").equalAny("Electronics", field("primaryType"));
-
-```
- |
-| [equalAny(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-field("category").equalAny(array(["Electronics", field("primaryType")]));
-
-```
- |
-| [euclideanDistance(vectorExpression)](./firestore_lite_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-field("location").euclideanDistance([37.7749, -122.4194]);
-
-```
- |
-| [euclideanDistance(vector)](./firestore_lite_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-field("location").euclideanDistance(new VectorValue([37.7749, -122.4194]));
-
-```
- |
-| [exists()](./firestore_lite_pipelines.expression.md#expressionexists) | | (Public Preview) Creates an expression that checks if a field exists in the document.
-```typescript
-// Check if the document has a field named "phoneNumber"
-field("phoneNumber").exists();
-
-```
- A new Expr representing the 'exists' check. |
-| [exp()](./firestore_lite_pipelines.expression.md#expressionexp) | | (Public Preview) Creates an expression that computes e to the power of this expression.
-```typescript
-// Compute e to the power of the 'value' field.
-field("value").exp();
-
-```
- A new representing the exp of the numeric value. |
-| [floor()](./firestore_lite_pipelines.expression.md#expressionfloor) | | (Public Preview) Creates an expression that computes the floor of a numeric value.
-```typescript
-// Compute the floor of the 'price' field.
-field("price").floor();
-
-```
- A new representing the floor of the numeric value. |
-| [greaterThan(expression)](./firestore_lite_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than another expression.
-```typescript
-// Check if the 'age' field is greater than the 'limit' field
-field("age").greaterThan(field("limit"));
-
-```
- |
-| [greaterThan(value)](./firestore_lite_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than a constant value.
-```typescript
-// Check if the 'price' field is greater than 100
-field("price").greaterThan(100);
-
-```
- |
-| [greaterThanOrEqual(expression)](./firestore_lite_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to another expression.
-```typescript
-// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1
-field("quantity").greaterThanOrEqual(field('requirement').add(1));
-
-```
- |
-| [greaterThanOrEqual(value)](./firestore_lite_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to a constant value.
-```typescript
-// Check if the 'score' field is greater than or equal to 80
-field("score").greaterThanOrEqual(80);
-
-```
- |
-| [ifAbsent(elseValue)](./firestore_lite_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of the this expression evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-field("optional_field").ifAbsent("default_value")
-
-```
- |
-| [ifAbsent(elseExpression)](./firestore_lite_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of this expression evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or if that is
-// absent, then returns the value of the field `
-field("optional_field").ifAbsent(field('default_field'))
-
-```
- |
-| [ifError(catchExpr)](./firestore_lite_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the result of the catchExpr argument if there is an error, else return the result of this expression.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// the entire title field if the array is empty or the field is another type.
-field("title").arrayGet(0).ifError(field("title"));
-
-```
- |
-| [ifError(catchValue)](./firestore_lite_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// "Default Title"
-field("title").arrayGet(0).ifError("Default Title");
-
-```
- |
-| [isAbsent()](./firestore_lite_pipelines.expression.md#expressionisabsent) | | (Public Preview) Creates an expression that returns true if the result of this expression is absent. Otherwise, returns false even if the value is null.
-```typescript
-// Check if the field `value` is absent.
-field("value").isAbsent();
-
-```
- A new representing the 'isAbsent' check. |
-| [isError()](./firestore_lite_pipelines.expression.md#expressioniserror) | | (Public Preview) Creates an expression that checks if a given expression produces an error.
-```typescript
-// Check if the result of a calculation is an error
-field("title").arrayContains(1).isError();
-
-```
- A new representing the 'isError' check. |
-| [join(delimiterExpression)](./firestore_lite_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-field("tags").join(field("separator"))
-
-```
- |
-| [join(delimiter)](./firestore_lite_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array field into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-field("tags").join(", ")
-
-```
- |
-| [length()](./firestore_lite_pipelines.expression.md#expressionlength) | | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes.
-```typescript
-// Get the length of the 'name' field.
-field("name").length();
-
-// Get the number of items in the 'cart' array.
-field("cart").length();
-
-```
- A new Expr representing the length of the string, array, map, vector, or bytes. |
-| [lessThan(experession)](./firestore_lite_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than another expression.
-```typescript
-// Check if the 'age' field is less than 'limit'
-field("age").lessThan(field('limit'));
-
-```
- |
-| [lessThan(value)](./firestore_lite_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than a constant value.
-```typescript
-// Check if the 'price' field is less than 50
-field("price").lessThan(50);
-
-```
- |
-| [lessThanOrEqual(expression)](./firestore_lite_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to another expression.
-```typescript
-// Check if the 'quantity' field is less than or equal to 20
-field("quantity").lessThan(constant(20));
-
-```
- |
-| [lessThanOrEqual(value)](./firestore_lite_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to a constant value.
-```typescript
-// Check if the 'score' field is less than or equal to 70
-field("score").lessThan(70);
-
-```
- |
-| [like(pattern)](./firestore_lite_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison.
-```typescript
-// Check if the 'title' field contains the word "guide" (case-sensitive)
-field("title").like("%guide%");
-
-```
- |
-| [like(pattern)](./firestore_lite_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison.
-```typescript
-// Check if the 'title' field contains the word "guide" (case-sensitive)
-field("title").like("%guide%");
-
-```
- |
-| [ln()](./firestore_lite_pipelines.expression.md#expressionln) | | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value.
-```typescript
-// Compute the natural logarithm of the 'value' field.
-field("value").ln();
-
-```
- A new representing the natural logarithm of the numeric value. |
-| [log10()](./firestore_lite_pipelines.expression.md#expressionlog10) | | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value.
-```typescript
-// Compute the base-10 logarithm of the 'value' field.
-field("value").log10();
-
-```
- A new representing the base-10 logarithm of the numeric value. |
-| [logicalMaximum(second, others)](./firestore_lite_pipelines.expression.md#expressionlogicalmaximum) | | (Public Preview) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering.
-```typescript
-// Returns the larger value between the 'timestamp' field and the current timestamp.
-field("timestamp").logicalMaximum(Function.currentTimestamp());
-
-```
- |
-| [logicalMinimum(second, others)](./firestore_lite_pipelines.expression.md#expressionlogicalminimum) | | (Public Preview) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering.
-```typescript
-// Returns the smaller value between the 'timestamp' field and the current timestamp.
-field("timestamp").logicalMinimum(Function.currentTimestamp());
-
-```
- |
-| [mapGet(subfield)](./firestore_lite_pipelines.expression.md#expressionmapget) | | (Public Preview) Accesses a value from a map (object) field using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-field("address").mapGet("city");
-
-```
- |
-| [mapMerge(secondMap, otherMaps)](./firestore_lite_pipelines.expression.md#expressionmapmerge) | | (Public Preview) Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-field('settings').mapMerge({ enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
- |
-| [mapRemove(key)](./firestore_lite_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression.
-```
-// Removes the key 'baz' from the input map.
-map({foo: 'bar', baz: true}).mapRemove('baz');
-
-```
- |
-| [mapRemove(keyExpr)](./firestore_lite_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression.
-```
-// Removes the key 'baz' from the input map.
-map({foo: 'bar', baz: true}).mapRemove(constant('baz'));
-
-```
- |
-| [maximum()](./firestore_lite_pipelines.expression.md#expressionmaximum) | | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-field("score").maximum().as("highestScore");
-
-```
- A new AggregateFunction representing the 'maximum' aggregation. |
-| [minimum()](./firestore_lite_pipelines.expression.md#expressionminimum) | | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs.
-```typescript
-// Find the lowest price of all products
-field("price").minimum().as("lowestPrice");
-
-```
- A new AggregateFunction representing the 'minimum' aggregation. |
-| [mod(expression)](./firestore_lite_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression.
-```typescript
-// Calculate the remainder of dividing the 'value' field by the 'divisor' field
-field("value").mod(field("divisor"));
-
-```
- |
-| [mod(value)](./firestore_lite_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value.
-```typescript
-// Calculate the remainder of dividing the 'value' field by 10
-field("value").mod(10);
-
-```
- |
-| [multiply(second)](./firestore_lite_pipelines.expression.md#expressionmultiply) | | (Public Preview) Creates an expression that multiplies this expression by another expression.
-```typescript
-// Multiply the 'quantity' field by the 'price' field
-field("quantity").multiply(field("price"));
-
-```
- |
-| [notEqual(expression)](./firestore_lite_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to another expression.
-```typescript
-// Check if the 'status' field is not equal to "completed"
-field("status").notEqual("completed");
-
-```
- |
-| [notEqual(value)](./firestore_lite_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to a constant value.
-```typescript
-// Check if the 'country' field is not equal to "USA"
-field("country").notEqual("USA");
-
-```
- |
-| [notEqualAny(values)](./firestore_lite_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-field("status").notEqualAny(["pending", field("rejectedStatus")]);
-
-```
- |
-| [notEqualAny(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression.
-```typescript
-// Check if the 'status' field is not equal to any value in the field 'rejectedStatuses'
-field("status").notEqualAny(field('rejectedStatuses'));
-
-```
- |
-| [pow(exponent)](./firestore_lite_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of another expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-field("base").pow(field("exponent"));
-
-```
- |
-| [pow(exponent)](./firestore_lite_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of a constant value.
-```typescript
-// Raise the value of the 'base' field to the power of 2.
-field("base").pow(2);
-
-```
- |
-| [regexContains(pattern)](./firestore_lite_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-field("description").regexContains("(?i)example");
-
-```
- |
-| [regexContains(pattern)](./firestore_lite_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains the regular expression stored in field 'regex'
-field("description").regexContains(field("regex"));
-
-```
- |
-| [regexMatch(pattern)](./firestore_lite_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-field("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
-
-```
- |
-| [regexMatch(pattern)](./firestore_lite_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a regular expression stored in field 'regex'
-field("email").regexMatch(field("regex"));
-
-```
- |
-| [reverse()](./firestore_lite_pipelines.expression.md#expressionreverse) | | (Public Preview) Creates an expression that reverses this string expression.
-```typescript
-// Reverse the value of the 'myString' field.
-field("myString").reverse();
-
-```
- A new representing the reversed string. |
-| [round()](./firestore_lite_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number.
-```typescript
-// Round the value of the 'price' field.
-field("price").round();
-
-```
- A new Expr representing the rounded value. |
-| [round(decimalPlaces)](./firestore_lite_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-field("price").round(2);
-
-```
- |
-| [round(decimalPlaces)](./firestore_lite_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
+| [abs()](./firestore_lite_pipelines.expression.md#expressionabs) | | (Public Preview) Creates an expression that computes the absolute value of a numeric value. |
+| [add(second)](./firestore_lite_pipelines.expression.md#expressionadd) | | (Public Preview) Creates an expression that adds this expression to another expression. |
+| [arrayConcat(secondArray, otherArrays)](./firestore_lite_pipelines.expression.md#expressionarrayconcat) | | (Public Preview) Creates an expression that concatenates an array expression with one or more other arrays. |
+| [arrayContains(expression)](./firestore_lite_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific element. |
+| [arrayContains(value)](./firestore_lite_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific value. |
+| [arrayContainsAll(values)](./firestore_lite_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements. |
+| [arrayContainsAll(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements. |
+| [arrayContainsAny(values)](./firestore_lite_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements. |
+| [arrayContainsAny(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements. |
+| [arrayGet(offset)](./firestore_lite_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayGet(offsetExpr)](./firestore_lite_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayLength()](./firestore_lite_pipelines.expression.md#expressionarraylength) | | (Public Preview) Creates an expression that calculates the length of an array. |
+| [arrayReverse()](./firestore_lite_pipelines.expression.md#expressionarrayreverse) | | (Public Preview) Creates an expression that reverses an array. |
+| [arraySum()](./firestore_lite_pipelines.expression.md#expressionarraysum) | | (Public Preview) Creates an expression that computes the sum of the elements in an array. |
+| [as(name)](./firestore_lite_pipelines.expression.md#expressionas) | | (Public Preview) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. |
+| [asBoolean()](./firestore_lite_pipelines.expression.md#expressionasboolean) | | (Public Preview) Wraps the expression in a \[BooleanExpression\]. |
+| [ascending()](./firestore_lite_pipelines.expression.md#expressionascending) | | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. |
+| [average()](./firestore_lite_pipelines.expression.md#expressionaverage) | | (Public Preview) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. |
+| [byteLength()](./firestore_lite_pipelines.expression.md#expressionbytelength) | | (Public Preview) Creates an expression that calculates the length of this string expression in bytes. |
+| [ceil()](./firestore_lite_pipelines.expression.md#expressionceil) | | (Public Preview) Creates an expression that computes the ceiling of a numeric value. |
+| [charLength()](./firestore_lite_pipelines.expression.md#expressioncharlength) | | (Public Preview) Creates an expression that calculates the character length of a string in UTF-8. |
+| [collectionId()](./firestore_lite_pipelines.expression.md#expressioncollectionid) | | (Public Preview) Creates an expression that returns the collection ID from a path. |
+| [concat(second, others)](./firestore_lite_pipelines.expression.md#expressionconcat) | | (Public Preview) Creates an expression that concatenates expression results together. |
+| [cosineDistance(vectorExpression)](./firestore_lite_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the cosine distance between two vectors. |
+| [cosineDistance(vector)](./firestore_lite_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the Cosine distance between two vectors. |
+| [count()](./firestore_lite_pipelines.expression.md#expressioncount) | | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. |
+| [countDistinct()](./firestore_lite_pipelines.expression.md#expressioncountdistinct) | | (Public Preview) Creates an aggregation that counts the number of distinct values of the expression or field. |
+| [descending()](./firestore_lite_pipelines.expression.md#expressiondescending) | | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on this expression. |
+| [divide(divisor)](./firestore_lite_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by another expression. |
+| [divide(divisor)](./firestore_lite_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by a constant value. |
+| [documentId()](./firestore_lite_pipelines.expression.md#expressiondocumentid) | | (Public Preview) Creates an expression that returns the document ID from a path. |
+| [dotProduct(vectorExpression)](./firestore_lite_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors. |
+| [dotProduct(vector)](./firestore_lite_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors. |
+| [endsWith(suffix)](./firestore_lite_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix. |
+| [endsWith(suffix)](./firestore_lite_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix (represented as an expression). |
+| [equal(expression)](./firestore_lite_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to another expression. |
+| [equal(value)](./firestore_lite_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to a constant value. |
+| [equalAny(values)](./firestore_lite_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions. |
+| [equalAny(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions. |
+| [euclideanDistance(vectorExpression)](./firestore_lite_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors. |
+| [euclideanDistance(vector)](./firestore_lite_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors. |
+| [exists()](./firestore_lite_pipelines.expression.md#expressionexists) | | (Public Preview) Creates an expression that checks if a field exists in the document. |
+| [exp()](./firestore_lite_pipelines.expression.md#expressionexp) | | (Public Preview) Creates an expression that computes e to the power of this expression. |
+| [floor()](./firestore_lite_pipelines.expression.md#expressionfloor) | | (Public Preview) Creates an expression that computes the floor of a numeric value. |
+| [greaterThan(expression)](./firestore_lite_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than another expression. |
+| [greaterThan(value)](./firestore_lite_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than a constant value. |
+| [greaterThanOrEqual(expression)](./firestore_lite_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to another expression. |
+| [greaterThanOrEqual(value)](./firestore_lite_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to a constant value. |
+| [ifAbsent(elseValue)](./firestore_lite_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of the this expression evaluation. |
+| [ifAbsent(elseExpression)](./firestore_lite_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of this expression evaluation.
```typescript
-// Round the value of the 'price' field to two decimal places.
-field("price").round(constant(2));
+// Returns the value of the optional field 'optional_field', or if that is
+// absent, then returns the value of the field `
+field("optional_field").ifAbsent(field('default_field'))
```
|
+| [ifError(catchExpr)](./firestore_lite_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the result of the catchExpr argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_lite_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [isAbsent()](./firestore_lite_pipelines.expression.md#expressionisabsent) | | (Public Preview) Creates an expression that returns true if the result of this expression is absent. Otherwise, returns false even if the value is null. |
+| [isError()](./firestore_lite_pipelines.expression.md#expressioniserror) | | (Public Preview) Creates an expression that checks if a given expression produces an error. |
+| [join(delimiterExpression)](./firestore_lite_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array into a string. |
+| [join(delimiter)](./firestore_lite_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array field into a string. |
+| [length()](./firestore_lite_pipelines.expression.md#expressionlength) | | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
+| [lessThan(experession)](./firestore_lite_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than another expression. |
+| [lessThan(value)](./firestore_lite_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than a constant value. |
+| [lessThanOrEqual(expression)](./firestore_lite_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to another expression. |
+| [lessThanOrEqual(value)](./firestore_lite_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to a constant value. |
+| [like(pattern)](./firestore_lite_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison. |
+| [like(pattern)](./firestore_lite_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison. |
+| [ln()](./firestore_lite_pipelines.expression.md#expressionln) | | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value. |
+| [log10()](./firestore_lite_pipelines.expression.md#expressionlog10) | | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value. |
+| [logicalMaximum(second, others)](./firestore_lite_pipelines.expression.md#expressionlogicalmaximum) | | (Public Preview) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. |
+| [logicalMinimum(second, others)](./firestore_lite_pipelines.expression.md#expressionlogicalminimum) | | (Public Preview) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. |
+| [mapGet(subfield)](./firestore_lite_pipelines.expression.md#expressionmapget) | | (Public Preview) Accesses a value from a map (object) field using the provided key. |
+| [mapMerge(secondMap, otherMaps)](./firestore_lite_pipelines.expression.md#expressionmapmerge) | | (Public Preview) Creates an expression that merges multiple map values. |
+| [mapRemove(key)](./firestore_lite_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression. |
+| [mapRemove(keyExpr)](./firestore_lite_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression. |
+| [maximum()](./firestore_lite_pipelines.expression.md#expressionmaximum) | | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. |
+| [minimum()](./firestore_lite_pipelines.expression.md#expressionminimum) | | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. |
+| [mod(expression)](./firestore_lite_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. |
+| [mod(value)](./firestore_lite_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. |
+| [multiply(second)](./firestore_lite_pipelines.expression.md#expressionmultiply) | | (Public Preview) Creates an expression that multiplies this expression by another expression. |
+| [notEqual(expression)](./firestore_lite_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to another expression. |
+| [notEqual(value)](./firestore_lite_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to a constant value. |
+| [notEqualAny(values)](./firestore_lite_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the provided values or expressions. |
+| [notEqualAny(arrayExpression)](./firestore_lite_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression. |
+| [pow(exponent)](./firestore_lite_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of another expression. |
+| [pow(exponent)](./firestore_lite_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of a constant value. |
+| [regexContains(pattern)](./firestore_lite_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring. |
+| [regexContains(pattern)](./firestore_lite_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring. |
+| [regexMatch(pattern)](./firestore_lite_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression. |
+| [regexMatch(pattern)](./firestore_lite_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression. |
+| [reverse()](./firestore_lite_pipelines.expression.md#expressionreverse) | | (Public Preview) Creates an expression that reverses this string expression. |
+| [round()](./firestore_lite_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number. |
+| [round(decimalPlaces)](./firestore_lite_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
+| [round(decimalPlaces)](./firestore_lite_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
| [split(delimiter)](./firestore_lite_pipelines.expression.md#expressionsplit) | | (Public Preview) Creates an expression that splits the result of this expression into an array of substrings based on the provided delimiter. |
| [split(delimiter)](./firestore_lite_pipelines.expression.md#expressionsplit) | | (Public Preview) Creates an expression that splits the result of this expression into an array of substrings based on the provided delimiter. |
-| [sqrt()](./firestore_lite_pipelines.expression.md#expressionsqrt) | | (Public Preview) Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-field("value").sqrt();
-
-```
- A new representing the square root of the numeric value. |
-| [startsWith(prefix)](./firestore_lite_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix.
-```typescript
-// Check if the 'name' field starts with "Mr."
-field("name").startsWith("Mr.");
-
-```
- |
-| [startsWith(prefix)](./firestore_lite_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix (represented as an expression).
-```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-field("fullName").startsWith(field("firstName"));
-
-```
- |
-| [stringConcat(secondString, otherStrings)](./firestore_lite_pipelines.expression.md#expressionstringconcat) | | (Public Preview) Creates an expression that concatenates string expressions together.
-```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-field("firstName").stringConcat(constant(" "), field("lastName"));
-
-```
- |
-| [stringContains(substring)](./firestore_lite_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified substring.
-```typescript
-// Check if the 'description' field contains "example".
-field("description").stringContains("example");
-
-```
- |
-| [stringContains(expr)](./firestore_lite_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains the string represented by another expression.
-```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-field("description").stringContains(field("keyword"));
-
-```
- |
-| [stringReverse()](./firestore_lite_pipelines.expression.md#expressionstringreverse) | | (Public Preview) Creates an expression that reverses a string.
-```typescript
-// Reverse the value of the 'myString' field.
-field("myString").stringReverse();
-
-```
- A new representing the reversed string. |
+| [sqrt()](./firestore_lite_pipelines.expression.md#expressionsqrt) | | (Public Preview) Creates an expression that computes the square root of a numeric value. |
+| [startsWith(prefix)](./firestore_lite_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix. |
+| [startsWith(prefix)](./firestore_lite_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix (represented as an expression). |
+| [stringConcat(secondString, otherStrings)](./firestore_lite_pipelines.expression.md#expressionstringconcat) | | (Public Preview) Creates an expression that concatenates string expressions together. |
+| [stringContains(substring)](./firestore_lite_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified substring. |
+| [stringContains(expr)](./firestore_lite_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains the string represented by another expression. |
+| [stringReverse()](./firestore_lite_pipelines.expression.md#expressionstringreverse) | | (Public Preview) Creates an expression that reverses a string. |
| [substring(position, length)](./firestore_lite_pipelines.expression.md#expressionsubstring) | | (Public Preview) Creates an expression that returns a substring of the results of this expression. |
| [substring(position, length)](./firestore_lite_pipelines.expression.md#expressionsubstring) | | (Public Preview) Creates an expression that returns a substring of the results of this expression. |
-| [subtract(subtrahend)](./firestore_lite_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts another expression from this expression.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-field("price").subtract(field("discount"));
-
-```
- |
-| [subtract(subtrahend)](./firestore_lite_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts a constant value from this expression.
-```typescript
-// Subtract 20 from the value of the 'total' field
-field("total").subtract(20);
-
-```
- |
-| [sum()](./firestore_lite_pipelines.expression.md#expressionsum) | | (Public Preview) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-field("orderAmount").sum().as("totalRevenue");
-
-```
- A new AggregateFunction representing the 'sum' aggregation. |
-| [timestampAdd(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression.
-```typescript
-// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
-field("timestamp").timestampAdd(field("unit"), field("amount"));
-
-```
- |
-| [timestampAdd(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression.
-```typescript
-// Add 1 day to the 'timestamp' field.
-field("timestamp").timestampAdd("day", 1);
-
-```
- |
-| [timestampSubtract(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression.
-```typescript
-// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
-field("timestamp").timestampSubtract(field("unit"), field("amount"));
-
-```
- |
-| [timestampSubtract(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression.
-```typescript
-// Subtract 1 day from the 'timestamp' field.
-field("timestamp").timestampSubtract("day", 1);
-
-```
- |
-| [timestampToUnixMicros()](./firestore_lite_pipelines.expression.md#expressiontimestamptounixmicros) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-field("timestamp").timestampToUnixMicros();
-
-```
- A new representing the number of microseconds since epoch. |
-| [timestampToUnixMillis()](./firestore_lite_pipelines.expression.md#expressiontimestamptounixmillis) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-field("timestamp").timestampToUnixMillis();
-
-```
- A new representing the number of milliseconds since epoch. |
-| [timestampToUnixSeconds()](./firestore_lite_pipelines.expression.md#expressiontimestamptounixseconds) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-field("timestamp").timestampToUnixSeconds();
-
-```
- A new representing the number of seconds since epoch. |
+| [subtract(subtrahend)](./firestore_lite_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts another expression from this expression. |
+| [subtract(subtrahend)](./firestore_lite_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts a constant value from this expression. |
+| [sum()](./firestore_lite_pipelines.expression.md#expressionsum) | | (Public Preview) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. |
+| [timestampAdd(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression. |
+| [timestampAdd(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression. |
+| [timestampSubtract(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression. |
+| [timestampSubtract(unit, amount)](./firestore_lite_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression. |
+| [timestampToUnixMicros()](./firestore_lite_pipelines.expression.md#expressiontimestamptounixmicros) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixMillis()](./firestore_lite_pipelines.expression.md#expressiontimestamptounixmillis) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixSeconds()](./firestore_lite_pipelines.expression.md#expressiontimestamptounixseconds) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
| [timestampTruncate(granularity, timezone)](./firestore_lite_pipelines.expression.md#expressiontimestamptruncate) | | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
| [timestampTruncate(granularity, timezone)](./firestore_lite_pipelines.expression.md#expressiontimestamptruncate) | | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
-| [toLower()](./firestore_lite_pipelines.expression.md#expressiontolower) | | (Public Preview) Creates an expression that converts a string to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-field("name").toLower();
-
-```
- A new Expr representing the lowercase string. |
-| [toUpper()](./firestore_lite_pipelines.expression.md#expressiontoupper) | | (Public Preview) Creates an expression that converts a string to uppercase.
-```typescript
-// Convert the 'title' field to uppercase
-field("title").toUpper();
-
-```
- A new Expr representing the uppercase string. |
-| [trim(valueToTrim)](./firestore_lite_pipelines.expression.md#expressiontrim) | | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array.
-```typescript
-// Trim whitespace from the 'userInput' field
-field("userInput").trim();
-
-// Trim quotes from the 'userInput' field
-field("userInput").trim('"');
-
-```
- |
+| [toLower()](./firestore_lite_pipelines.expression.md#expressiontolower) | | (Public Preview) Creates an expression that converts a string to lowercase. |
+| [toUpper()](./firestore_lite_pipelines.expression.md#expressiontoupper) | | (Public Preview) Creates an expression that converts a string to uppercase. |
+| [trim(valueToTrim)](./firestore_lite_pipelines.expression.md#expressiontrim) | | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array. |
| [type()](./firestore_lite_pipelines.expression.md#expressiontype) | | (Public Preview) Creates an expression that returns the data type of this expression's result, as a string. |
-| [unixMicrosToTimestamp()](./firestore_lite_pipelines.expression.md#expressionunixmicrostotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-field("microseconds").unixMicrosToTimestamp();
-
-```
- A new representing the timestamp. |
-| [unixMillisToTimestamp()](./firestore_lite_pipelines.expression.md#expressionunixmillistotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-field("milliseconds").unixMillisToTimestamp();
-
-```
- A new representing the timestamp. |
-| [unixSecondsToTimestamp()](./firestore_lite_pipelines.expression.md#expressionunixsecondstotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-field("seconds").unixSecondsToTimestamp();
-
-```
- A new representing the timestamp. |
-| [vectorLength()](./firestore_lite_pipelines.expression.md#expressionvectorlength) | | (Public Preview) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression.
-```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-field("embedding").vectorLength();
-
-```
- A new representing the length of the vector. |
+| [unixMicrosToTimestamp()](./firestore_lite_pipelines.expression.md#expressionunixmicrostotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixMillisToTimestamp()](./firestore_lite_pipelines.expression.md#expressionunixmillistotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixSecondsToTimestamp()](./firestore_lite_pipelines.expression.md#expressionunixsecondstotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [vectorLength()](./firestore_lite_pipelines.expression.md#expressionvectorlength) | | (Public Preview) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. |
## Expression.expressionType
@@ -871,28 +184,53 @@ abstract readonly expressionType: ExpressionType;
Creates an expression that computes the absolute value of a numeric value.
+Signature:
+
+```typescript
+abs(): FunctionExpression;
+```
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the absolute value of the numeric value.
+
+### Example
+
+
```typescript
// Compute the absolute value of the 'price' field.
field("price").abs();
```
- A new representing the absolute value of the numeric value.
+
+## Expression.add()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds this expression to another expression.
Signature:
```typescript
-abs(): FunctionExpression;
+add(second: Expression | unknown): FunctionExpression;
```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The expression or literal to add to this expression. |
+
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.add()
+A new `Expression` representing the addition operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds this expression to another expression.
```typescript
// Add the value of the 'quantity' field and the 'reserve' field.
@@ -900,28 +238,34 @@ field("quantity").add(field("reserve"));
```
+## Expression.arrayConcat()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates an array expression with one or more other arrays.
+
Signature:
```typescript
-add(second: Expression | unknown): FunctionExpression;
+arrayConcat(secondArray: Expression | unknown[], ...otherArrays: ArrayExpr representing the concatenated array. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The element to search for in the array. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContains()
+A new `Expression` representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains a specific element.
```typescript
// Check if the 'sizes' array contains the value from the 'selectedSize' field
@@ -959,28 +307,33 @@ field("sizes").arrayContains(field("selectedSize"));
```
+## Expression.arrayContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains a specific value.
+
Signature:
```typescript
-arrayContains(expression: Expression): BooleanExpression;
+arrayContains(value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. |
+| value | unknown | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContains()
+A new `Expression` representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains a specific value.
```typescript
// Check if the 'colors' array contains "red"
@@ -988,28 +341,33 @@ field("colors").arrayContains("red");
```
+## Expression.arrayContainsAll()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains all the specified elements.
+
Signature:
```typescript
-arrayContains(value: unknown): BooleanExpression;
+arrayContainsAll(values: ArrayExpr representing the 'array\_contains' comparison. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAll()
+A new `Expression` representing the 'array\_contains\_all' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains all the specified elements.
```typescript
// Check if the 'tags' array contains both the value in field "tag1" and the literal value "tag2"
@@ -1017,28 +375,33 @@ field("tags").arrayContainsAll([field("tag1"), "tag2"]);
```
+## Expression.arrayContainsAll()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains all the specified elements.
+
Signature:
```typescript
-arrayContainsAll(values: ArrayExpr representing the 'array\_contains\_all' comparison. |
+| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAll()
+A new `Expression` representing the 'array\_contains\_all' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains all the specified elements.
```typescript
// Check if the 'tags' array contains both of the values from field "tag1" and the literal value "tag2"
@@ -1046,28 +409,33 @@ field("tags").arrayContainsAll(array([field("tag1"), "tag2"]));
```
+## Expression.arrayContainsAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains any of the specified elements.
+
Signature:
```typescript
-arrayContainsAll(arrayExpression: Expression): BooleanExpression;
+arrayContainsAny(values: ArrayExpr representing the 'array\_contains\_all' comparison. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAny()
+A new `Expression` representing the 'array\_contains\_any' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains any of the specified elements.
```typescript
// Check if the 'categories' array contains either values from field "cate1" or "cate2"
@@ -1075,28 +443,33 @@ field("categories").arrayContainsAny([field("cate1"), field("cate2")]);
```
+## Expression.arrayContainsAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains any of the specified elements.
+
Signature:
```typescript
-arrayContainsAny(values: ArrayExpr representing the 'array\_contains\_any' comparison. |
+| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAny()
+A new `Expression` representing the 'array\_contains\_any' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains any of the specified elements.
```typescript
// Check if the 'groups' array contains either the value from the 'userGroup' field
@@ -1105,28 +478,33 @@ field("groups").arrayContainsAny(array([field("userGroup"), "guest"]));
```
+## Expression.arrayGet()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
-arrayContainsAny(arrayExpression: Expression): BooleanExpression;
+arrayGet(offset: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. |
+| offset | number | The index of the element to return. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayGet()
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
// Return the value in the 'tags' field array at index `1`.
@@ -1134,28 +512,33 @@ field('tags').arrayGet(1);
```
+## Expression.arrayGet()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
-arrayGet(offset: number): FunctionExpression;
+arrayGet(offsetExpr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| offset | number | The index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| offsetExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expression evaluating to the index of the element to return. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayGet()
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
// Return the value in the tags field array at index specified by field
@@ -1164,90 +547,86 @@ field('tags').arrayGet(field('favoriteTag'));
```
-Signature:
+## Expression.arrayLength()
-```typescript
-arrayGet(offsetExpr: Expression): FunctionExpression;
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-#### Parameters
+Creates an expression that calculates the length of an array.
-| Parameter | Type | Description |
-| --- | --- | --- |
-| offsetExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expr evaluating to the index of the element to return. A new Expr representing the 'arrayGet' operation. |
+Signature:
+```typescript
+arrayLength(): FunctionExpression;
+```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayLength()
+A new `Expression` representing the length of the array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of an array.
```typescript
// Get the number of items in the 'cart' array
field("cart").arrayLength();
```
- A new `Expr` representing the length of the array.
+
+## Expression.arrayReverse()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses an array.
Signature:
```typescript
-arrayLength(): FunctionExpression;
+arrayReverse(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayReverse()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses an array.
```typescript
// Reverse the value of the 'myArray' field.
field("myArray").arrayReverse();
```
- A new representing the reversed array.
+
+## Expression.arraySum()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the sum of the elements in an array.
Signature:
```typescript
-arrayReverse(): FunctionExpression;
+arraySum(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arraySum()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the sum of the elements in the array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the sum of the elements in an array.
```typescript
// Compute the sum of the elements in the 'scores' field.
field("scores").arraySum();
```
- A new representing the sum of the elements in the array.
-
-Signature:
-
-```typescript
-arraySum(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
## Expression.as()
@@ -1258,13 +637,6 @@ Assigns an alias to this expression.
Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values.
-```typescript
-// Calculate the total price and assign it the alias "totalPrice" and add it to the output.
-firestore.pipeline().collection("items")
- .addFields(field("price").multiply(field("quantity")).as("totalPrice"));
-
-```
-
Signature:
```typescript
@@ -1275,12 +647,24 @@ as(name: string): AliasedExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| name | string | The alias to assign to this expression. A new that wraps this expression and associates it with the provided alias. |
+| name | string | The alias to assign to this expression. |
Returns:
[AliasedExpression](./firestore_lite_pipelines.aliasedexpression.md#aliasedexpression_class)
+A new [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class) that wraps this expression and associates it with the provided alias.
+
+### Example
+
+
+```typescript
+// Calculate the total price and assign it the alias "totalPrice" and add it to the output.
+firestore.pipeline().collection("items")
+ .addFields(field("price").multiply(field("quantity")).as("totalPrice"));
+
+```
+
## Expression.asBoolean()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1288,8 +672,6 @@ as(name: string): AliasedExpression;
Wraps the expression in a \[BooleanExpression\].
- A \[BooleanExpression\] representing the same expression.
-
Signature:
```typescript
@@ -1299,12 +681,28 @@ asBoolean(): BooleanExpression;
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+A \[BooleanExpression\] representing the same expression.
+
## Expression.ascending()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an that sorts documents in ascending order based on this expression.
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on this expression.
+
+Signature:
+
+```typescript
+ascending(): Ordering;
+```
+Returns:
+
+[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
+
+A new `Ordering` for ascending sorting.
+
+### Example
+
```typescript
// Sort documents by the 'name' field in ascending order
@@ -1312,131 +710,141 @@ pipeline().collection("users")
.sort(field("name").ascending());
```
- A new `Ordering` for ascending sorting.
+
+## Expression.average()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs.
Signature:
```typescript
-ascending(): Ordering;
+average(): AggregateFunction;
```
Returns:
-[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
+[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.average()
+A new `AggregateFunction` representing the 'average' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs.
```typescript
// Calculate the average age of users
field("age").average().as("averageAge");
```
- A new `AggregateFunction` representing the 'average' aggregation.
+
+## Expression.byteLength()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of this string expression in bytes.
Signature:
```typescript
-average(): AggregateFunction;
+byteLength(): FunctionExpression;
```
Returns:
-[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.byteLength()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string in bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of this string expression in bytes.
```typescript
// Calculate the length of the 'myString' field in bytes.
field("myString").byteLength();
```
- A new representing the length of the string in bytes.
+
+## Expression.ceil()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the ceiling of a numeric value.
Signature:
```typescript
-byteLength(): FunctionExpression;
+ceil(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.ceil()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the ceiling of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the ceiling of a numeric value.
```typescript
// Compute the ceiling of the 'price' field.
field("price").ceil();
```
- A new representing the ceiling of the numeric value.
+
+## Expression.charLength()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the character length of a string in UTF-8.
Signature:
```typescript
-ceil(): FunctionExpression;
+charLength(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.charLength()
+A new `Expression` representing the length of the string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the character length of a string in UTF-8.
```typescript
// Get the character length of the 'name' field in its UTF-8 form.
field("name").charLength();
```
- A new `Expr` representing the length of the string.
+
+## Expression.collectionId()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the collection ID from a path.
Signature:
```typescript
-charLength(): FunctionExpression;
+collectionId(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.collectionId()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the collectionId operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the collection ID from a path.
```typescript
// Get the collection ID from a path.
field("__path__").collectionId();
```
- A new representing the collectionId operation.
-
-Signature:
-
-```typescript
-collectionId(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
## Expression.concat()
@@ -1445,12 +853,6 @@ collectionId(): FunctionExpression;
Creates an expression that concatenates expression results together.
-```typescript
-// Combine the 'firstName', ' ', and 'lastName' fields into a single value.
-field("firstName").concat(constant(" "), field("lastName"));
-
-```
-
Signature:
```typescript
@@ -1462,25 +864,30 @@ concat(second: Expression | unknown, ...others: ArrayExpr representing the concatenated value. |
+| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals to concatenate. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.cosineDistance()
+A new `Expression` representing the concatenated value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the cosine distance between two vectors.
```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-field("userVector").cosineDistance(field("itemVector"));
+// Combine the 'firstName', ' ', and 'lastName' fields into a single value.
+field("firstName").concat(constant(" "), field("lastName"));
```
+## Expression.cosineDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the cosine distance between two vectors.
+
Signature:
```typescript
@@ -1491,25 +898,30 @@ cosineDistance(vectorExpression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.cosineDistance()
+A new `Expression` representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between two vectors.
```typescript
-// Calculate the Cosine distance between the 'location' field and a target location
-field("location").cosineDistance(new VectorValue([37.7749, -122.4194]));
+// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
+field("userVector").cosineDistance(field("itemVector"));
```
+## Expression.cosineDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Cosine distance between two vectors.
+
Signature:
```typescript
@@ -1520,25 +932,29 @@ cosineDistance(vector: VectorValue | number[]): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| vector | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine\* distance between the two vectors. |
+| vector | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.count()
+A new `Expression` representing the Cosine\* distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field.
```typescript
-// Count the total number of products
-field("productId").count().as("totalProducts");
+// Calculate the Cosine distance between the 'location' field and a target location
+field("location").cosineDistance(new VectorValue([37.7749, -122.4194]));
```
- A new `AggregateFunction` representing the 'count' aggregation.
+
+## Expression.count()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field.
Signature:
@@ -1549,19 +965,23 @@ count(): AggregateFunction;
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.countDistinct()
+A new `AggregateFunction` representing the 'count' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of distinct values of the expression or field.
```typescript
-// Count the distinct number of products
-field("productId").countDistinct().as("distinctProducts");
+// Count the total number of products
+field("productId").count().as("totalProducts");
```
- A new `AggregateFunction` representing the 'count\_distinct' aggregation.
+
+## Expression.countDistinct()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of distinct values of the expression or field.
Signature:
@@ -1572,20 +992,23 @@ countDistinct(): AggregateFunction;
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.descending()
+A new `AggregateFunction` representing the 'count\_distinct' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an that sorts documents in descending order based on this expression.
```typescript
-// Sort documents by the 'createdAt' field in descending order
-firestore.pipeline().collection("users")
- .sort(field("createdAt").descending());
+// Count the distinct number of products
+field("productId").countDistinct().as("distinctProducts");
```
- A new `Ordering` for descending sorting.
+
+## Expression.descending()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on this expression.
Signature:
@@ -1596,19 +1019,25 @@ descending(): Ordering;
[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
-## Expression.divide()
+A new `Ordering` for descending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides this expression by another expression.
```typescript
-// Divide the 'total' field by the 'count' field
-field("total").divide(field("count"));
+// Sort documents by the 'createdAt' field in descending order
+firestore.pipeline().collection("users")
+ .sort(field("createdAt").descending());
```
+## Expression.divide()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides this expression by another expression.
+
Signature:
```typescript
@@ -1619,25 +1048,30 @@ divide(divisor: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| divisor | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to divide by. A new Expr representing the division operation. |
+| divisor | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to divide by. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.divide()
+A new `Expression` representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides this expression by a constant value.
```typescript
-// Divide the 'value' field by 10
-field("value").divide(10);
+// Divide the 'total' field by the 'count' field
+field("total").divide(field("count"));
```
+## Expression.divide()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides this expression by a constant value.
+
Signature:
```typescript
@@ -1648,12 +1082,23 @@ divide(divisor: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| divisor | number | The constant value to divide by. A new Expr representing the division operation. |
+| divisor | number | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the division operation.
+
+### Example
+
+
+```typescript
+// Divide the 'value' field by 10
+field("value").divide(10);
+
+```
+
## Expression.documentId()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1661,28 +1106,53 @@ divide(divisor: number): FunctionExpression;
Creates an expression that returns the document ID from a path.
+Signature:
+
+```typescript
+documentId(): FunctionExpression;
+```
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the documentId operation.
+
+### Example
+
+
```typescript
// Get the document ID from a path.
field("__path__").documentId();
```
- A new representing the documentId operation.
+
+## Expression.dotProduct()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between two vectors.
Signature:
```typescript
-documentId(): FunctionExpression;
+dotProduct(vectorExpression: Expression): FunctionExpression;
```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. |
+
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.dotProduct()
+A new `Expression` representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between two vectors.
```typescript
// Calculate the dot product between a feature vector and a target vector
@@ -1690,28 +1160,33 @@ field("features").dotProduct([0.5, 0.8, 0.2]);
```
+## Expression.dotProduct()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between two vectors.
+
Signature:
```typescript
-dotProduct(vectorExpression: Expression): FunctionExpression;
+dotProduct(vector: VectorValue | number[]): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. |
+| vector | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as an array of numbers) to calculate with. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.dotProduct()
+A new `Expression` representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between two vectors.
```typescript
// Calculate the dot product between a feature vector and a target vector
@@ -1719,28 +1194,33 @@ field("features").dotProduct(new VectorValue([0.5, 0.8, 0.2]));
```
+## Expression.endsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string ends with a given postfix.
+
Signature:
```typescript
-dotProduct(vector: VectorValue | number[]): FunctionExpression;
+endsWith(suffix: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| vector | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. |
+| suffix | string | The postfix to check for. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.endsWith()
+A new `Expression` representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string ends with a given postfix.
```typescript
// Check if the 'filename' field ends with ".txt"
@@ -1748,28 +1228,33 @@ field("filename").endsWith(".txt");
```
+## Expression.endsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string ends with a given postfix (represented as an expression).
+
Signature:
```typescript
-endsWith(suffix: string): BooleanExpression;
+endsWith(suffix: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. |
+| suffix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The postfix expression to check for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.endsWith()
+A new `Expression` representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string ends with a given postfix (represented as an expression).
```typescript
// Check if the 'url' field ends with the value of the 'extension' field
@@ -1777,28 +1262,33 @@ field("url").endsWith(field("extension"));
```
+## Expression.equal()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to another expression.
+
Signature:
```typescript
-endsWith(suffix: Expression): BooleanExpression;
+equal(expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| suffix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for equality. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equal()
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to another expression.
```typescript
// Check if the 'age' field is equal to 21
@@ -1806,28 +1296,33 @@ field("age").equal(21);
```
+## Expression.equal()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to a constant value.
+
Signature:
```typescript
-equal(expression: Expression): BooleanExpression;
+equal(value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for equality. A new Expr representing the equality comparison. |
+| value | unknown | The constant value to compare for equality. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equal()
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to a constant value.
```typescript
// Check if the 'city' field is equal to "London"
@@ -1835,28 +1330,33 @@ field("city").equal("London");
```
+## Expression.equalAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to any of the provided values or expressions.
+
Signature:
```typescript
-equal(value: unknown): BooleanExpression;
+equalAny(values: ArrayExpr representing the equality comparison. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The values or expressions to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equalAny()
+A new `Expression` representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -1864,28 +1364,33 @@ field("category").equalAny("Electronics", field("primaryType"));
```
+## Expression.equalAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to any of the provided values or expressions.
+
Signature:
```typescript
-equalAny(values: ArrayExpr representing the 'IN' comparison. |
+| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression that evaluates to an array of values to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equalAny()
+A new `Expression` representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -1893,28 +1398,33 @@ field("category").equalAny(array(["Electronics", field("primaryType")]));
```
+## Expression.euclideanDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between two vectors.
+
Signature:
```typescript
-equalAny(arrayExpression: Expression): BooleanExpression;
+euclideanDistance(vectorExpression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression that evaluates to an array of values to check against. A new Expr representing the 'IN' comparison. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.euclideanDistance()
+A new `Expression` representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between two vectors.
```typescript
// Calculate the Euclidean distance between the 'location' field and a target location
@@ -1922,28 +1432,33 @@ field("location").euclideanDistance([37.7749, -122.4194]);
```
+## Expression.euclideanDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between two vectors.
+
Signature:
```typescript
-euclideanDistance(vectorExpression: Expression): FunctionExpression;
+euclideanDistance(vector: VectorValue | number[]): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. |
+| vector | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.euclideanDistance()
+A new `Expression` representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between two vectors.
```typescript
// Calculate the Euclidean distance between the 'location' field and a target location
@@ -1951,90 +1466,86 @@ field("location").euclideanDistance(new VectorValue([37.7749, -122.4194]));
```
-Signature:
+## Expression.exists()
-```typescript
-euclideanDistance(vector: VectorValue | number[]): FunctionExpression;
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-#### Parameters
+Creates an expression that checks if a field exists in the document.
-| Parameter | Type | Description |
-| --- | --- | --- |
-| vector | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. |
+Signature:
+```typescript
+exists(): BooleanExpression;
+```
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.exists()
+A new `Expression` representing the 'exists' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field exists in the document.
```typescript
// Check if the document has a field named "phoneNumber"
field("phoneNumber").exists();
```
- A new `Expr` representing the 'exists' check.
+
+## Expression.exp()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes e to the power of this expression.
Signature:
```typescript
-exists(): BooleanExpression;
+exp(): FunctionExpression;
```
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.exp()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the exp of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes e to the power of this expression.
```typescript
// Compute e to the power of the 'value' field.
field("value").exp();
```
- A new representing the exp of the numeric value.
+
+## Expression.floor()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the floor of a numeric value.
Signature:
```typescript
-exp(): FunctionExpression;
+floor(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.floor()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the floor of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the floor of a numeric value.
```typescript
// Compute the floor of the 'price' field.
field("price").floor();
```
- A new representing the floor of the numeric value.
-
-Signature:
-
-```typescript
-floor(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
## Expression.greaterThan()
@@ -2043,12 +1554,6 @@ floor(): FunctionExpression;
Creates an expression that checks if this expression is greater than another expression.
-```typescript
-// Check if the 'age' field is greater than the 'limit' field
-field("age").greaterThan(field("limit"));
-
-```
-
Signature:
```typescript
@@ -2059,25 +1564,30 @@ greaterThan(expression: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for greater than. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.greaterThan()
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is greater than a constant value.
```typescript
-// Check if the 'price' field is greater than 100
-field("price").greaterThan(100);
+// Check if the 'age' field is greater than the 'limit' field
+field("age").greaterThan(field("limit"));
```
+## Expression.greaterThan()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is greater than a constant value.
+
Signature:
```typescript
@@ -2088,25 +1598,30 @@ greaterThan(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for greater than. A new Expr representing the greater than comparison. |
+| value | unknown | The constant value to compare for greater than. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.greaterThanOrEqual()
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is greater than or equal to another expression.
```typescript
-// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1
-field("quantity").greaterThanOrEqual(field('requirement').add(1));
+// Check if the 'price' field is greater than 100
+field("price").greaterThan(100);
```
+## Expression.greaterThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is greater than or equal to another expression.
+
Signature:
```typescript
@@ -2117,25 +1632,30 @@ greaterThanOrEqual(expression: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for greater than or equal to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.greaterThanOrEqual()
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is greater than or equal to a constant value.
```typescript
-// Check if the 'score' field is greater than or equal to 80
-field("score").greaterThanOrEqual(80);
+// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1
+field("quantity").greaterThanOrEqual(field('requirement').add(1));
```
+## Expression.greaterThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is greater than or equal to a constant value.
+
Signature:
```typescript
@@ -2146,26 +1666,30 @@ greaterThanOrEqual(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. |
+| value | unknown | The constant value to compare for greater than or equal to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.ifAbsent()
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `elseValue` argument if this expression results in an absent value, else return the result of the this expression evaluation.
```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-field("optional_field").ifAbsent("default_value")
+// Check if the 'score' field is greater than or equal to 80
+field("score").greaterThanOrEqual(80);
```
+## Expression.ifAbsent()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `elseValue` argument if this expression results in an absent value, else return the result of the this expression evaluation.
+
Signature:
```typescript
@@ -2176,12 +1700,24 @@ ifAbsent(elseValue: unknown): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| elseValue | unknown | The value that will be returned if this Expression evaluates to an absent value. A new \[Expression\] representing the ifAbsent operation. |
+| elseValue | unknown | The value that will be returned if this Expression evaluates to an absent value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new \[Expression\] representing the ifAbsent operation.
+
+### Example
+
+
+```typescript
+// Returns the value of the optional field 'optional_field', or returns 'default_value'
+// if the field is absent.
+field("optional_field").ifAbsent("default_value")
+
+```
+
## Expression.ifAbsent()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2206,12 +1742,14 @@ ifAbsent(elseExpression: unknown): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| elseExpression | unknown | The Expression that will be evaluated if this Expression evaluates to an absent value. A new \[Expression\] representing the ifAbsent operation. |
+| elseExpression | unknown | The Expression that will be evaluated if this Expression evaluates to an absent value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new \[Expression\] representing the ifAbsent operation.
+
## Expression.ifError()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2219,13 +1757,6 @@ ifAbsent(elseExpression: unknown): Expression;
Creates an expression that returns the result of the `catchExpr` argument if there is an error, else return the result of this expression.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// the entire title field if the array is empty or the field is another type.
-field("title").arrayGet(0).ifError(field("title"));
-
-```
-
Signature:
```typescript
@@ -2236,25 +1767,30 @@ ifError(catchExpr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The catch expression that will be evaluated and returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The catch expression that will be evaluated and returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
// Returns the first item in the title field arrays, or returns
-// "Default Title"
-field("title").arrayGet(0).ifError("Default Title");
+// the entire title field if the array is empty or the field is another type.
+field("title").arrayGet(0).ifError(field("title"));
+
+```
+
+## Expression.ifError()
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
Signature:
@@ -2266,25 +1802,30 @@ ifError(catchValue: unknown): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | unknown | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | unknown | The value that will be returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.isAbsent()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns `true` if the result of this expression is absent. Otherwise, returns `false` even if the value is `null`.
```typescript
-// Check if the field `value` is absent.
-field("value").isAbsent();
+// Returns the first item in the title field arrays, or returns
+// "Default Title"
+field("title").arrayGet(0).ifError("Default Title");
```
- A new representing the 'isAbsent' check.
+
+## Expression.isAbsent()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns `true` if the result of this expression is absent. Otherwise, returns `false` even if the value is `null`.
Signature:
@@ -2295,19 +1836,24 @@ isAbsent(): BooleanExpression;
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.isError()
+A new [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) representing the 'isAbsent' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a given expression produces an error.
```typescript
-// Check if the result of a calculation is an error
-field("title").arrayContains(1).isError();
+// Check if the field `value` is absent.
+field("value").isAbsent();
+@example
```
- A new representing the 'isError' check.
+
+## Expression.isError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a given expression produces an error.
Signature:
@@ -2318,19 +1864,24 @@ isError(): BooleanExpression;
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.join()
+A new [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) representing the 'isError' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-field("tags").join(field("separator"))
+// Check if the result of a calculation is an error
+field("title").arrayContains(1).isError();
```
+## Expression.join()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2341,25 +1892,30 @@ join(delimiterExpression: Expression): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| delimiterExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. A new Expression representing the join operation. |
+| delimiterExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
-## Expression.join()
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array field into a string.
```typescript
-// Join the elements of the 'tags' field with a comma and space.
-field("tags").join(", ")
+// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
+field("tags").join(field("separator"))
```
+## Expression.join()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array field into a string.
+
Signature:
```typescript
@@ -2370,28 +1926,29 @@ join(delimiter: string): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| delimiter | string | The string to use as a delimiter. A new Expression representing the join operation. |
+| delimiter | string | The string to use as a delimiter. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
-## Expression.length()
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string, array, map, vector, or bytes.
```typescript
-// Get the length of the 'name' field.
-field("name").length();
-
-// Get the number of items in the 'cart' array.
-field("cart").length();
+// Join the elements of the 'tags' field with a comma and space.
+field("tags").join(", ")
```
- A new `Expr` representing the length of the string, array, map, vector, or bytes.
+
+## Expression.length()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string, array, map, vector, or bytes.
Signature:
@@ -2402,19 +1959,27 @@ length(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.lessThan()
+A new `Expression` representing the length of the string, array, map, vector, or bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than another expression.
```typescript
-// Check if the 'age' field is less than 'limit'
-field("age").lessThan(field('limit'));
+// Get the length of the 'name' field.
+field("name").length();
+
+// Get the number of items in the 'cart' array.
+field("cart").length();
```
+## Expression.lessThan()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than another expression.
+
Signature:
```typescript
@@ -2425,25 +1990,30 @@ lessThan(experession: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| experession | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for less than. A new Expr representing the less than comparison. |
+| experession | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for less than. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.lessThan()
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than a constant value.
```typescript
-// Check if the 'price' field is less than 50
-field("price").lessThan(50);
+// Check if the 'age' field is less than 'limit'
+field("age").lessThan(field('limit'));
```
+## Expression.lessThan()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than a constant value.
+
Signature:
```typescript
@@ -2454,25 +2024,30 @@ lessThan(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for less than. A new Expr representing the less than comparison. |
+| value | unknown | The constant value to compare for less than. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.lessThanOrEqual()
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than or equal to another expression.
```typescript
-// Check if the 'quantity' field is less than or equal to 20
-field("quantity").lessThan(constant(20));
+// Check if the 'price' field is less than 50
+field("price").lessThan(50);
```
+## Expression.lessThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than or equal to another expression.
+
Signature:
```typescript
@@ -2483,25 +2058,30 @@ lessThanOrEqual(expression: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for less than or equal to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.lessThanOrEqual()
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than or equal to a constant value.
```typescript
-// Check if the 'score' field is less than or equal to 70
-field("score").lessThan(70);
+// Check if the 'quantity' field is less than or equal to 20
+field("quantity").lessThan(constant(20));
```
+## Expression.lessThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than or equal to a constant value.
+
Signature:
```typescript
@@ -2512,25 +2092,30 @@ lessThanOrEqual(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. |
+| value | unknown | The constant value to compare for less than or equal to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.like()
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive string comparison.
```typescript
-// Check if the 'title' field contains the word "guide" (case-sensitive)
-field("title").like("%guide%");
+// Check if the 'score' field is less than or equal to 70
+field("score").lessThan(70);
```
+## Expression.like()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive string comparison.
+
Signature:
```typescript
@@ -2541,18 +2126,16 @@ like(pattern: string): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. |
+| pattern | string | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.like()
+A new `Expression` representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive string comparison.
```typescript
// Check if the 'title' field contains the word "guide" (case-sensitive)
@@ -2560,6 +2143,13 @@ field("title").like("%guide%");
```
+## Expression.like()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive string comparison.
+
Signature:
```typescript
@@ -2570,25 +2160,29 @@ like(pattern: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. |
+| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.ln()
+A new `Expression` representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the natural logarithm of a numeric value.
```typescript
-// Compute the natural logarithm of the 'value' field.
-field("value").ln();
+// Check if the 'title' field contains the word "guide" (case-sensitive)
+field("title").like("%guide%");
```
- A new representing the natural logarithm of the numeric value.
+
+## Expression.ln()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the natural logarithm of a numeric value.
Signature:
@@ -2599,19 +2193,23 @@ ln(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.log10()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the natural logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the base-10 logarithm of a numeric value.
```typescript
-// Compute the base-10 logarithm of the 'value' field.
-field("value").log10();
+// Compute the natural logarithm of the 'value' field.
+field("value").ln();
```
- A new representing the base-10 logarithm of the numeric value.
+
+## Expression.log10()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the base-10 logarithm of a numeric value.
Signature:
@@ -2622,19 +2220,24 @@ log10(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.logicalMaximum()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the base-10 logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering.
```typescript
-// Returns the larger value between the 'timestamp' field and the current timestamp.
-field("timestamp").logicalMaximum(Function.currentTimestamp());
+// Compute the base-10 logarithm of the 'value' field.
+field("value").log10();
```
+## Expression.logicalMaximum()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering.
+
Signature:
```typescript
@@ -2646,25 +2249,30 @@ logicalMaximum(second: Expression | unknown, ...others: ArrayExpr representing the value associated with the given key in the map. |
+| subfield | string | The key to access in the map. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the value associated with the given key in the map.
+
+### Example
+
+
+```typescript
+// Get the 'city' value from the 'address' map field
+field("address").mapGet("city");
+
+```
+
## Expression.mapMerge()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2718,13 +2342,6 @@ mapGet(subfield: string): FunctionExpression;
Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-field('settings').mapMerge({ enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
-
Signature:
```typescript
@@ -2742,7 +2359,17 @@ mapMerge(secondMap: RecordExpr representing the modulo operation. |
+| value | number | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.mod()
+A new `Expression` representing the modulo operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value.
```typescript
// Calculate the remainder of dividing the 'value' field by 10
@@ -2894,28 +2562,33 @@ field("value").mod(10);
```
+## Expression.multiply()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that multiplies this expression by another expression.
+
Signature:
```typescript
-mod(value: number): FunctionExpression;
+multiply(second: Expression | number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| value | number | The constant value to divide by. A new Expr representing the modulo operation. |
+| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| number | The second expression or literal to multiply by. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.multiply()
+A new `Expression` representing the multiplication operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that multiplies this expression by another expression.
```typescript
// Multiply the 'quantity' field by the 'price' field
@@ -2923,28 +2596,33 @@ field("quantity").multiply(field("price"));
```
+## Expression.notEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to another expression.
+
Signature:
```typescript
-multiply(second: Expression | number): FunctionExpression;
+notEqual(expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| number | The second expression or literal to multiply by. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for inequality. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqual()
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to another expression.
```typescript
// Check if the 'status' field is not equal to "completed"
@@ -2952,28 +2630,33 @@ field("status").notEqual("completed");
```
+## Expression.notEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to a constant value.
+
Signature:
```typescript
-notEqual(expression: Expression): BooleanExpression;
+notEqual(value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. |
+| value | unknown | The constant value to compare for inequality. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqual()
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to a constant value.
```typescript
// Check if the 'country' field is not equal to "USA"
@@ -2981,28 +2664,33 @@ field("country").notEqual("USA");
```
+## Expression.notEqualAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to any of the provided values or expressions.
+
Signature:
```typescript
-notEqual(value: unknown): BooleanExpression;
+notEqualAny(values: ArrayExpr representing the inequality comparison. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The values or expressions to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqualAny()
+A new `Expression` representing the 'notEqualAny' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to any of the provided values or expressions.
```typescript
// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
@@ -3010,28 +2698,33 @@ field("status").notEqualAny(["pending", field("rejectedStatus")]);
```
+## Expression.notEqualAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression.
+
Signature:
```typescript
-notEqualAny(values: ArrayExpr representing the 'notEqualAny' comparison. |
+| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The values or expressions to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqualAny()
+A new `Expression` representing the 'notEqualAny' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression.
```typescript
// Check if the 'status' field is not equal to any value in the field 'rejectedStatuses'
@@ -3039,28 +2732,33 @@ field("status").notEqualAny(field('rejectedStatuses'));
```
+## Expression.pow()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of this expression raised to the power of another expression.
+
Signature:
```typescript
-notEqualAny(arrayExpression: Expression): BooleanExpression;
+pow(exponent: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The values or expressions to check against. A new Expr representing the 'notEqualAny' comparison. |
+| exponent | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise this expression to the power of. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.pow()
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of this expression raised to the power of another expression.
```typescript
// Raise the value of the 'base' field to the power of the 'exponent' field.
@@ -3068,28 +2766,33 @@ field("base").pow(field("exponent"));
```
+## Expression.pow()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of this expression raised to the power of a constant value.
+
Signature:
```typescript
-pow(exponent: Expression): FunctionExpression;
+pow(exponent: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| exponent | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise this expression to the power of. A new Expr representing the power operation. |
+| exponent | number | The constant value to raise this expression to the power of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.pow()
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of this expression raised to the power of a constant value.
```typescript
// Raise the value of the 'base' field to the power of 2.
@@ -3097,57 +2800,67 @@ field("base").pow(2);
```
+## Expression.regexContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string contains a specified regular expression as a substring.
+
Signature:
```typescript
-pow(exponent: number): FunctionExpression;
+regexContains(pattern: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| exponent | number | The constant value to raise this expression to the power of. A new Expr representing the power operation. |
+| pattern | string | The regular expression to use for the search. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexContains()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string contains a specified regular expression as a substring.
```typescript
// Check if the 'description' field contains "example" (case-insensitive)
field("description").regexContains("(?i)example");
-```
+```
+
+## Expression.regexContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string contains a specified regular expression as a substring.
Signature:
```typescript
-regexContains(pattern: string): BooleanExpression;
+regexContains(pattern: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. |
+| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The regular expression to use for the search. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexContains()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string contains a specified regular expression as a substring.
```typescript
// Check if the 'description' field contains the regular expression stored in field 'regex'
@@ -3155,28 +2868,33 @@ field("description").regexContains(field("regex"));
```
+## Expression.regexMatch()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string matches a specified regular expression.
+
Signature:
```typescript
-regexContains(pattern: Expression): BooleanExpression;
+regexMatch(pattern: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. |
+| pattern | string | The regular expression to use for the match. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexMatch()
+A new `Expression` representing the regular expression match.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string matches a specified regular expression.
```typescript
// Check if the 'email' field matches a valid email pattern
@@ -3184,28 +2902,33 @@ field("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
```
+## Expression.regexMatch()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string matches a specified regular expression.
+
Signature:
```typescript
-regexMatch(pattern: string): BooleanExpression;
+regexMatch(pattern: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. |
+| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The regular expression to use for the match. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexMatch()
+A new `Expression` representing the regular expression match.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string matches a specified regular expression.
```typescript
// Check if the 'email' field matches a regular expression stored in field 'regex'
@@ -3213,67 +2936,59 @@ field("email").regexMatch(field("regex"));
```
-Signature:
+## Expression.reverse()
-```typescript
-regexMatch(pattern: Expression): BooleanExpression;
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-#### Parameters
+Creates an expression that reverses this string expression.
-| Parameter | Type | Description |
-| --- | --- | --- |
-| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The regular expression to use for the match. A new Expr representing the regular expression match. |
+Signature:
+```typescript
+reverse(): FunctionExpression;
+```
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.reverse()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses this string expression.
```typescript
// Reverse the value of the 'myString' field.
field("myString").reverse();
```
- A new representing the reversed string.
+
+## Expression.round()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the nearest whole number.
Signature:
```typescript
-reverse(): FunctionExpression;
+round(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.round()
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the nearest whole number.
```typescript
// Round the value of the 'price' field.
field("price").round();
```
- A new `Expr` representing the rounded value.
-
-Signature:
-
-```typescript
-round(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
## Expression.round()
@@ -3282,12 +2997,6 @@ round(): FunctionExpression;
Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-field("price").round(2);
-
-```
-
Signature:
```typescript
@@ -3298,25 +3007,30 @@ round(decimalPlaces: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| decimalPlaces | number | A constant specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | number | A constant specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.round()
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the specified number of decimal places.
```typescript
// Round the value of the 'price' field to two decimal places.
-field("price").round(constant(2));
+field("price").round(2);
```
+## Expression.round()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the specified number of decimal places.
+
Signature:
```typescript
@@ -3327,12 +3041,23 @@ round(decimalPlaces: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| decimalPlaces | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the rounded value.
+
+### Example
+
+
+```typescript
+// Round the value of the 'price' field to two decimal places.
+field("price").round(constant(2));
+
+```
+
## Expression.split()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3356,6 +3081,8 @@ split(delimiter: string): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3364,7 +3091,6 @@ split(delimiter: string): FunctionExpression;
field('scoresCsv').split(',')
```
- A new representing the split function.
## Expression.split()
@@ -3389,6 +3115,8 @@ split(delimiter: Expression): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3397,7 +3125,6 @@ split(delimiter: Expression): FunctionExpression;
field('scores').split(conditional(field('format').equal('csv'), constant(','), constant(':'))
```
- A new representing the split function.
## Expression.sqrt()
@@ -3406,13 +3133,6 @@ field('scores').split(conditional(field('format').equal('csv'), constant(','), c
Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-field("value").sqrt();
-
-```
- A new representing the square root of the numeric value.
-
Signature:
```typescript
@@ -3422,19 +3142,24 @@ sqrt(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.startsWith()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the square root of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string starts with a given prefix.
```typescript
-// Check if the 'name' field starts with "Mr."
-field("name").startsWith("Mr.");
+// Compute the square root of the 'value' field.
+field("value").sqrt();
```
+## Expression.startsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string starts with a given prefix.
+
Signature:
```typescript
@@ -3445,25 +3170,30 @@ startsWith(prefix: string): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. |
+| prefix | string | The prefix to check for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.startsWith()
+A new `Expression` representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string starts with a given prefix (represented as an expression).
```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-field("fullName").startsWith(field("firstName"));
+// Check if the 'name' field starts with "Mr."
+field("name").startsWith("Mr.");
```
+## Expression.startsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string starts with a given prefix (represented as an expression).
+
Signature:
```typescript
@@ -3474,25 +3204,30 @@ startsWith(prefix: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| prefix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. |
+| prefix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The prefix expression to check for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.stringConcat()
+A new `Expression` representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that concatenates string expressions together.
```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-field("firstName").stringConcat(constant(" "), field("lastName"));
+// Check if the 'fullName' field starts with the value of the 'firstName' field
+field("fullName").startsWith(field("firstName"));
```
+## Expression.stringConcat()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates string expressions together.
+
Signature:
```typescript
@@ -3504,25 +3239,30 @@ stringConcat(secondString: Expression | string, ...otherStrings: ArrayExpr representing the 'contains' comparison. |
+| substring | string | The substring to search for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.stringContains()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string contains the string represented by another expression.
```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-field("description").stringContains(field("keyword"));
+// Check if the 'description' field contains "example".
+field("description").stringContains("example");
```
+## Expression.stringContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string contains the string represented by another expression.
+
Signature:
```typescript
@@ -3562,25 +3307,29 @@ stringContains(expr: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the substring to search for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.stringReverse()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses a string.
```typescript
-// Reverse the value of the 'myString' field.
-field("myString").stringReverse();
+// Check if the 'description' field contains the value of the 'keyword' field.
+field("description").stringContains(field("keyword"));
```
- A new representing the reversed string.
+
+## Expression.stringReverse()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses a string.
Signature:
@@ -3591,6 +3340,17 @@ stringReverse(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
+
+### Example
+
+
+```typescript
+// Reverse the value of the 'myString' field.
+field("myString").stringReverse();
+
+```
+
## Expression.substring()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3646,12 +3406,6 @@ substring(position: Expression, length?: Expression): FunctionExpression;
Creates an expression that subtracts another expression from this expression.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-field("price").subtract(field("discount"));
-
-```
-
Signature:
```typescript
@@ -3662,25 +3416,30 @@ subtract(subtrahend: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| subtrahend | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. |
+| subtrahend | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract from this expression. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.subtract()
+A new `Expression` representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a constant value from this expression.
```typescript
-// Subtract 20 from the value of the 'total' field
-field("total").subtract(20);
+// Subtract the 'discount' field from the 'price' field
+field("price").subtract(field("discount"));
```
+## Expression.subtract()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a constant value from this expression.
+
Signature:
```typescript
@@ -3691,11 +3450,22 @@ subtract(subtrahend: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| subtrahend | number | The constant value to subtract. A new Expr representing the subtraction operation. |
+| subtrahend | number | The constant value to subtract. |
+
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new `Expression` representing the subtraction operation.
+
+### Example
-Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+```typescript
+// Subtract 20 from the value of the 'total' field
+field("total").subtract(20);
+
+```
## Expression.sum()
@@ -3704,13 +3474,6 @@ subtract(subtrahend: number): FunctionExpression;
Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-field("orderAmount").sum().as("totalRevenue");
-
-```
- A new `AggregateFunction` representing the 'sum' aggregation.
-
Signature:
```typescript
@@ -3720,19 +3483,24 @@ sum(): AggregateFunction;
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.timestampAdd()
+A new `AggregateFunction` representing the 'sum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds a specified amount of time to this timestamp expression.
```typescript
-// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
-field("timestamp").timestampAdd(field("unit"), field("amount"));
+// Calculate the total revenue from a set of orders
+field("orderAmount").sum().as("totalRevenue");
```
+## Expression.timestampAdd()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds a specified amount of time to this timestamp expression.
+
Signature:
```typescript
@@ -3744,25 +3512,30 @@ timestampAdd(unit: Expression, amount: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| unit | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. |
-| amount | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. |
+| amount | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampAdd()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds a specified amount of time to this timestamp expression.
```typescript
-// Add 1 day to the 'timestamp' field.
-field("timestamp").timestampAdd("day", 1);
+// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
+field("timestamp").timestampAdd(field("unit"), field("amount"));
```
+## Expression.timestampAdd()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds a specified amount of time to this timestamp expression.
+
Signature:
```typescript
@@ -3774,25 +3547,30 @@ timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour'
| Parameter | Type | Description |
| --- | --- | --- |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). |
-| amount | number | The amount of time to add. A new representing the resulting timestamp. |
+| amount | number | The amount of time to add. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampSubtract()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a specified amount of time from this timestamp expression.
```typescript
-// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
-field("timestamp").timestampSubtract(field("unit"), field("amount"));
+// Add 1 day to the 'timestamp' field.
+field("timestamp").timestampAdd("day", 1);
```
+## Expression.timestampSubtract()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a specified amount of time from this timestamp expression.
+
Signature:
```typescript
@@ -3804,25 +3582,30 @@ timestampSubtract(unit: Expression, amount: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| unit | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. |
-| amount | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. |
+| amount | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampSubtract()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a specified amount of time from this timestamp expression.
```typescript
-// Subtract 1 day from the 'timestamp' field.
-field("timestamp").timestampSubtract("day", 1);
+// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
+field("timestamp").timestampSubtract(field("unit"), field("amount"));
```
+## Expression.timestampSubtract()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a specified amount of time from this timestamp expression.
+
Signature:
```typescript
@@ -3834,25 +3617,29 @@ timestampSubtract(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'h
| Parameter | Type | Description |
| --- | --- | --- |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). |
-| amount | number | The amount of time to subtract. A new representing the resulting timestamp. |
+| amount | number | The amount of time to subtract. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampToUnixMicros()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-field("timestamp").timestampToUnixMicros();
+// Subtract 1 day from the 'timestamp' field.
+field("timestamp").timestampSubtract("day", 1);
```
- A new representing the number of microseconds since epoch.
+
+## Expression.timestampToUnixMicros()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
Signature:
@@ -3863,19 +3650,23 @@ timestampToUnixMicros(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampToUnixMillis()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of microseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-field("timestamp").timestampToUnixMillis();
+// Convert the 'timestamp' field to microseconds since epoch.
+field("timestamp").timestampToUnixMicros();
```
- A new representing the number of milliseconds since epoch.
+
+## Expression.timestampToUnixMillis()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
Signature:
@@ -3886,19 +3677,23 @@ timestampToUnixMillis(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampToUnixSeconds()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of milliseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-field("timestamp").timestampToUnixSeconds();
+// Convert the 'timestamp' field to milliseconds since epoch.
+field("timestamp").timestampToUnixMillis();
```
- A new representing the number of seconds since epoch.
+
+## Expression.timestampToUnixSeconds()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
Signature:
@@ -3909,6 +3704,17 @@ timestampToUnixSeconds(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of seconds since epoch.
+
+### Example
+
+
+```typescript
+// Convert the 'timestamp' field to seconds since epoch.
+field("timestamp").timestampToUnixSeconds();
+
+```
+
## Expression.timestampTruncate()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3927,12 +3733,14 @@ timestampTruncate(granularity: TimeGranularity, timezone?: string | Expression):
| Parameter | Type | Description |
| --- | --- | --- |
| granularity | [TimeGranularity](./firestore_lite_pipelines.md#timegranularity) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -3960,12 +3768,14 @@ timestampTruncate(granularity: Expression, timezone?: string | Expression): Func
| Parameter | Type | Description |
| --- | --- | --- |
| granularity | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -3982,13 +3792,6 @@ field('createdAt').timestampTruncate(field('granularity'))
Creates an expression that converts a string to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-field("name").toLower();
-
-```
- A new `Expr` representing the lowercase string.
-
Signature:
```typescript
@@ -3998,19 +3801,23 @@ toLower(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.toUpper()
+A new `Expression` representing the lowercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a string to uppercase.
```typescript
-// Convert the 'title' field to uppercase
-field("title").toUpper();
+// Convert the 'name' field to lowercase
+field("name").toLower();
```
- A new `Expr` representing the uppercase string.
+
+## Expression.toUpper()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a string to uppercase.
Signature:
@@ -4021,22 +3828,24 @@ toUpper(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.trim()
+A new `Expression` representing the uppercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that removes leading and trailing characters from a string or byte array.
```typescript
-// Trim whitespace from the 'userInput' field
-field("userInput").trim();
-
-// Trim quotes from the 'userInput' field
-field("userInput").trim('"');
+// Convert the 'title' field to uppercase
+field("title").toUpper();
```
+## Expression.trim()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that removes leading and trailing characters from a string or byte array.
+
Signature:
```typescript
@@ -4047,12 +3856,26 @@ trim(valueToTrim?: string | Expression | Bytes): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| valueToTrim | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| [Bytes](./firestore_lite.bytes.md#bytes_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. A new Expr representing the trimmed string or byte array. |
+| valueToTrim | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| [Bytes](./firestore_lite.bytes.md#bytes_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the trimmed string or byte array.
+
+### Example
+
+
+```typescript
+// Trim whitespace from the 'userInput' field
+field("userInput").trim();
+
+// Trim quotes from the 'userInput' field
+field("userInput").trim('"');
+
+```
+
## Expression.type()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -4069,6 +3892,8 @@ type(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the data type.
+
### Example
@@ -4077,7 +3902,6 @@ type(): FunctionExpression;
field('title').type()
```
- A new {Expression} representing the data type.
## Expression.unixMicrosToTimestamp()
@@ -4086,13 +3910,6 @@ field('title').type()
Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-field("microseconds").unixMicrosToTimestamp();
-
-```
- A new representing the timestamp.
-
Signature:
```typescript
@@ -4102,19 +3919,23 @@ unixMicrosToTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.unixMillisToTimestamp()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-field("milliseconds").unixMillisToTimestamp();
+// Interpret the 'microseconds' field as microseconds since epoch.
+field("microseconds").unixMicrosToTimestamp();
```
- A new representing the timestamp.
+
+## Expression.unixMillisToTimestamp()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
Signature:
@@ -4125,19 +3946,23 @@ unixMillisToTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.unixSecondsToTimestamp()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-field("seconds").unixSecondsToTimestamp();
+// Interpret the 'milliseconds' field as milliseconds since epoch.
+field("milliseconds").unixMillisToTimestamp();
```
- A new representing the timestamp.
+
+## Expression.unixSecondsToTimestamp()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
Signature:
@@ -4148,19 +3973,23 @@ unixSecondsToTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## Expression.vectorLength()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression.
```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-field("embedding").vectorLength();
+// Interpret the 'seconds' field as seconds since epoch.
+field("seconds").unixSecondsToTimestamp();
```
- A new representing the length of the vector.
+
+## Expression.vectorLength()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression.
Signature:
@@ -4171,3 +4000,14 @@ vectorLength(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the vector.
+
+### Example
+
+
+```typescript
+// Get the vector length (dimension) of the field 'embedding'.
+field("embedding").vectorLength();
+
+```
+
diff --git a/docs-devsite/firestore_lite_pipelines.field.md b/docs-devsite/firestore_lite_pipelines.field.md
index 37ec1ea479..f3b7ad7288 100644
--- a/docs-devsite/firestore_lite_pipelines.field.md
+++ b/docs-devsite/firestore_lite_pipelines.field.md
@@ -13,21 +13,12 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Represents a reference to a field in a Firestore document, or outputs of a stage.
+Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) stage.
Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.
You can create a `Field` instance using the static method:
-```typescript
-// Create a Field instance for the 'name' field
-const nameField = field("name");
-
-// Create a Field instance for a nested field 'address.city'
-const cityField = field("address.city");
-
-```
-
Signature:
```typescript
@@ -101,3 +92,16 @@ get fieldName(): string;
```typescript
selectable: true;
```
+
+### Example
+
+
+```typescript
+// Create a Field instance for the 'name' field
+const nameField = field("name");
+
+// Create a Field instance for a nested field 'address.city'
+const cityField = field("address.city");
+
+```
+
diff --git a/docs-devsite/firestore_lite_pipelines.functionexpression.md b/docs-devsite/firestore_lite_pipelines.functionexpression.md
index ef3a422c16..22f7670d2e 100644
--- a/docs-devsite/firestore_lite_pipelines.functionexpression.md
+++ b/docs-devsite/firestore_lite_pipelines.functionexpression.md
@@ -13,9 +13,9 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-This class defines the base class for Firestore functions, which can be evaluated within pipeline execution.
+This class defines the base class for Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.
-Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_.md#and_e72c712), , or the methods on (, , etc.) to construct new Function instances.
+Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_pipelines.md#and_e0c48bd), [equal()](./firestore_pipelines.md#equal_b3c3382), or the methods on [Expression](./firestore_pipelines.expression.md#expression_class) ([Expression.equal()](./firestore_pipelines.expression.md#expressionequal), [Expression.lessThan()](./firestore_pipelines.expression.md#expressionlessthan), etc.) to construct new Function instances.
Signature:
diff --git a/docs-devsite/firestore_lite_pipelines.md b/docs-devsite/firestore_lite_pipelines.md
index 8173c81da6..1f2599ce81 100644
--- a/docs-devsite/firestore_lite_pipelines.md
+++ b/docs-devsite/firestore_lite_pipelines.md
@@ -16,1618 +16,276 @@ https://github.com/firebase/firebase-js-sdk
| Function | Description |
| --- | --- |
| function() |
-| [countAll()](./firestore_lite_pipelines.md#countall) | (Public Preview) Creates an aggregation that counts the total number of stage inputs.
-```typescript
-// Count the total number of input documents
-countAll().as("totalDocument");
-
-```
- A new representing the 'countAll' aggregation. |
-| [currentTimestamp()](./firestore_lite_pipelines.md#currenttimestamp) | (Public Preview) Creates an expression that evaluates to the current server timestamp.
-```typescript
-// Get the current server timestamp
-currentTimestamp()
-
-```
- A new Expression representing the current server timestamp. |
+| [countAll()](./firestore_lite_pipelines.md#countall) | (Public Preview) Creates an aggregation that counts the total number of stage inputs. |
+| [currentTimestamp()](./firestore_lite_pipelines.md#currenttimestamp) | (Public Preview) Creates an expression that evaluates to the current server timestamp. |
| function(array, ...) |
-| [arrayContains(array, element)](./firestore_lite_pipelines.md#arraycontains_a00ea48) | (Public Preview) Creates an expression that checks if an array expression contains a specific element.
-```typescript
-// Check if the 'colors' array contains the value of field 'selectedColor'
-arrayContains(field("colors"), field("selectedColor"));
-
-```
- |
-| [arrayContains(array, element)](./firestore_lite_pipelines.md#arraycontains_7328608) | (Public Preview) Creates an expression that checks if an array expression contains a specific element.
-```typescript
-// Check if the 'colors' array contains "red"
-arrayContains(field("colors"), "red");
-
-```
- |
-| [arrayContainsAll(array, values)](./firestore_lite_pipelines.md#arraycontainsall_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements.
-```typescript
-// Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1"
-arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]);
-
-```
- |
-| [arrayContainsAll(array, arrayExpression)](./firestore_lite_pipelines.md#arraycontainsall_7b535db) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements.
-```typescript
-// Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1"
-arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]);
-
-```
- |
-| [arrayContainsAny(array, values)](./firestore_lite_pipelines.md#arraycontainsany_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements.
-```typescript
-// Check if the 'categories' array contains either values from field "cate1" or "Science"
-arrayContainsAny(field("categories"), [field("cate1"), "Science"]);
-
-```
- |
-| [arrayContainsAny(array, values)](./firestore_lite_pipelines.md#arraycontainsany_c381a96) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements.
-```typescript
-// Check if the 'categories' array contains either values from field "cate1" or "Science"
-arrayContainsAny(field("categories"), array([field("cate1"), "Science"]));
-
-```
- |
-| [arrayLength(array)](./firestore_lite_pipelines.md#arraylength_195e339) | (Public Preview) Creates an expression that calculates the length of an array expression.
-```typescript
-// Get the number of items in the 'cart' array
-arrayLength(field("cart"));
-
-```
- |
+| [arrayContains(array, element)](./firestore_lite_pipelines.md#arraycontains_a00ea48) | (Public Preview) Creates an expression that checks if an array expression contains a specific element. |
+| [arrayContains(array, element)](./firestore_lite_pipelines.md#arraycontains_7328608) | (Public Preview) Creates an expression that checks if an array expression contains a specific element. |
+| [arrayContainsAll(array, values)](./firestore_lite_pipelines.md#arraycontainsall_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements. |
+| [arrayContainsAll(array, arrayExpression)](./firestore_lite_pipelines.md#arraycontainsall_7b535db) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements. |
+| [arrayContainsAny(array, values)](./firestore_lite_pipelines.md#arraycontainsany_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements. |
+| [arrayContainsAny(array, values)](./firestore_lite_pipelines.md#arraycontainsany_c381a96) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements. |
+| [arrayLength(array)](./firestore_lite_pipelines.md#arraylength_195e339) | (Public Preview) Creates an expression that calculates the length of an array expression. |
| function(arrayExpression, ...) |
-| [arrayGet(arrayExpression, offset)](./firestore_lite_pipelines.md#arrayget_f2e27cc) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index 1.
-arrayGet(field('tags'), 1);
-
-```
- |
-| [arrayGet(arrayExpression, offsetExpr)](./firestore_lite_pipelines.md#arrayget_484550d) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet(field('tags'), field('favoriteTag'));
-
-```
- |
-| [join(arrayExpression, delimiterExpression)](./firestore_lite_pipelines.md#join_313e6aa) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join an array of string using the delimiter from the 'separator' field.
-join(array(['foo', 'bar']), field("separator"))
-
-```
- |
-| [join(arrayExpression, delimiter)](./firestore_lite_pipelines.md#join_d088d29) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join(field("tags"), ", ")
-
-```
- |
+| [arrayGet(arrayExpression, offset)](./firestore_lite_pipelines.md#arrayget_f2e27cc) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayGet(arrayExpression, offsetExpr)](./firestore_lite_pipelines.md#arrayget_484550d) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [join(arrayExpression, delimiterExpression)](./firestore_lite_pipelines.md#join_313e6aa) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
+| [join(arrayExpression, delimiter)](./firestore_lite_pipelines.md#join_d088d29) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
| function(arrayField, ...) |
-| [arrayGet(arrayField, offset)](./firestore_lite_pipelines.md#arrayget_3f58471) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index 1.
-arrayGet('tags', 1);
-
-```
- |
-| [arrayGet(arrayField, offsetExpr)](./firestore_lite_pipelines.md#arrayget_1904c9a) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet('tags', field('favoriteTag'));
-
-```
- |
+| [arrayGet(arrayField, offset)](./firestore_lite_pipelines.md#arrayget_3f58471) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayGet(arrayField, offsetExpr)](./firestore_lite_pipelines.md#arrayget_1904c9a) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
| function(arrayFieldName, ...) |
-| [join(arrayFieldName, delimiter)](./firestore_lite_pipelines.md#join_478ef36) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join("tags", ", ")
-
-```
- |
-| [join(arrayFieldName, delimiterExpression)](./firestore_lite_pipelines.md#join_829294c) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-join('tags', field("separator"))
-
-```
- |
+| [join(arrayFieldName, delimiter)](./firestore_lite_pipelines.md#join_478ef36) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
+| [join(arrayFieldName, delimiterExpression)](./firestore_lite_pipelines.md#join_829294c) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
| function(base, ...) |
-| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_e4a9e64) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow(field("base"), field("exponent"));
-
-```
- |
-| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_93eae7f) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent.
-```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow(field("base"), 2);
-
-```
- |
-| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_a237721) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow("base", field("exponent"));
-
-```
- |
-| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_f4d7908) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent.
-```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow("base", 2);
-
-```
- |
+| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_e4a9e64) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent expression. |
+| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_93eae7f) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent. |
+| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_a237721) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent expression. |
+| [pow(base, exponent)](./firestore_lite_pipelines.md#pow_f4d7908) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent. |
| function(booleanExpr, ...) |
-| [countIf(booleanExpr)](./firestore_lite_pipelines.md#countif_c5b8fb1) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the provided boolean expression evaluates to true.
-```typescript
-// Count the number of documents where 'is_active' field equals true
-countIf(field("is_active").equal(true)).as("numActiveDocuments");
-
-```
- |
-| [not(booleanExpr)](./firestore_lite_pipelines.md#not_c5b8fb1) | (Public Preview) Creates an expression that negates a filter condition.
-```typescript
-// Find documents where the 'completed' field is NOT true
-not(equal("completed", true));
-
-```
- |
+| [countIf(booleanExpr)](./firestore_lite_pipelines.md#countif_c5b8fb1) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the provided boolean expression evaluates to true. |
+| [not(booleanExpr)](./firestore_lite_pipelines.md#not_c5b8fb1) | (Public Preview) Creates an expression that negates a filter condition. |
| function(condition, ...) |
-| [conditional(condition, thenExpr, elseExpr)](./firestore_lite_pipelines.md#conditional_07a206d) | (Public Preview) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-conditional(
- greaterThan("age", 18), constant("Adult"), constant("Minor"));
-
-```
- |
+| [conditional(condition, thenExpr, elseExpr)](./firestore_lite_pipelines.md#conditional_07a206d) | (Public Preview) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. |
| function(documentPath, ...) |
-| [documentId(documentPath)](./firestore_lite_pipelines.md#documentid_cef293c) | (Public Preview) Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(myDocumentReference);
-
-```
- A new representing the documentId operation. |
+| [documentId(documentPath)](./firestore_lite_pipelines.md#documentid_cef293c) | (Public Preview) Creates an expression that returns the document ID from a path. |
| function(documentPathExpr, ...) |
-| [documentId(documentPathExpr)](./firestore_lite_pipelines.md#documentid_9a69021) | (Public Preview) Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(field("__path__"));
-
-```
- A new representing the documentId operation. |
+| [documentId(documentPathExpr)](./firestore_lite_pipelines.md#documentid_9a69021) | (Public Preview) Creates an expression that returns the document ID from a path. |
| function(element, ...) |
-| [notEqualAny(element, values)](./firestore_lite_pipelines.md#notequalany_c2c5bcb) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny(field("status"), ["pending", field("rejectedStatus")]);
-
-```
- |
-| [notEqualAny(element, arrayExpression)](./firestore_lite_pipelines.md#notequalany_16b2851) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of the field 'rejectedStatus'
-notEqualAny(field("status"), ["pending", field("rejectedStatus")]);
-
-```
- |
+| [notEqualAny(element, values)](./firestore_lite_pipelines.md#notequalany_c2c5bcb) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. |
+| [notEqualAny(element, arrayExpression)](./firestore_lite_pipelines.md#notequalany_16b2851) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. |
| function(elements, ...) |
-| [array(elements)](./firestore_lite_pipelines.md#array_7d853aa) | (Public Preview) Creates an expression that creates a Firestore array value from an input array.
-```typescript
-// Create an array value from the input array and reference the 'baz' field value from the input document.
-array(['bar', Field.of('baz')]).as('foo');
-
-```
- |
-| [map(elements)](./firestore_lite_pipelines.md#map_ce5dee1) | (Public Preview) Creates an expression that creates a Firestore map value from an input object.
-```typescript
-// Create a map from the input object and reference the 'baz' field value from the input document.
-map({foo: 'bar', baz: Field.of('baz')}).as('data');
-
-```
- |
+| [array(elements)](./firestore_lite_pipelines.md#array_7d853aa) | (Public Preview) Creates an expression that creates a Firestore array value from an input array. |
+| [map(elements)](./firestore_lite_pipelines.md#map_ce5dee1) | (Public Preview) Creates an expression that creates a Firestore map value from an input object. |
| function(expr, ...) |
| [abs(expr)](./firestore_lite_pipelines.md#abs_005f3d4) | (Public Preview) Creates an expression that computes the absolute value of a numeric value. |
-| [ascending(expr)](./firestore_lite_pipelines.md#ascending_005f3d4) | (Public Preview) Creates an that sorts documents in ascending order based on an expression.
-```typescript
-// Sort documents by the 'name' field in lowercase in ascending order
-firestore.pipeline().collection("users")
- .sort(ascending(field("name").toLower()));
-
-```
- |
-| [byteLength(expr)](./firestore_lite_pipelines.md#bytelength_005f3d4) | (Public Preview) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob.
-```typescript
-// Calculate the length of the 'myString' field in bytes.
-byteLength(field("myString"));
-
-```
- |
+| [ascending(expr)](./firestore_lite_pipelines.md#ascending_005f3d4) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on an expression. |
+| [byteLength(expr)](./firestore_lite_pipelines.md#bytelength_005f3d4) | (Public Preview) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. |
| [countDistinct(expr)](./firestore_lite_pipelines.md#countdistinct_3c28b08) | (Public Preview) Creates an aggregation that counts the number of distinct values of a field. |
-| [descending(expr)](./firestore_lite_pipelines.md#descending_005f3d4) | (Public Preview) Creates an that sorts documents in descending order based on an expression.
-```typescript
-// Sort documents by the 'name' field in lowercase in descending order
-firestore.pipeline().collection("users")
- .sort(descending(field("name").toLower()));
-
-```
- |
+| [descending(expr)](./firestore_lite_pipelines.md#descending_005f3d4) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on an expression. |
| [floor(expr)](./firestore_lite_pipelines.md#floor_005f3d4) | (Public Preview) Creates an expression that computes the floor of a numeric value. |
-| [timestampToUnixMicros(expr)](./firestore_lite_pipelines.md#timestamptounixmicros_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros(field("timestamp"));
-
-```
- |
-| [timestampToUnixMillis(expr)](./firestore_lite_pipelines.md#timestamptounixmillis_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis(field("timestamp"));
-
-```
- |
-| [timestampToUnixSeconds(expr)](./firestore_lite_pipelines.md#timestamptounixseconds_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds(field("timestamp"));
-
-```
- |
-| [unixMicrosToTimestamp(expr)](./firestore_lite_pipelines.md#unixmicrostotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp(field("microseconds"));
-
-```
- |
-| [unixMillisToTimestamp(expr)](./firestore_lite_pipelines.md#unixmillistotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp(field("milliseconds"));
-
-```
- |
-| [unixSecondsToTimestamp(expr)](./firestore_lite_pipelines.md#unixsecondstotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp(field("seconds"));
-
-```
- |
+| [timestampToUnixMicros(expr)](./firestore_lite_pipelines.md#timestamptounixmicros_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixMillis(expr)](./firestore_lite_pipelines.md#timestamptounixmillis_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixSeconds(expr)](./firestore_lite_pipelines.md#timestamptounixseconds_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [unixMicrosToTimestamp(expr)](./firestore_lite_pipelines.md#unixmicrostotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixMillisToTimestamp(expr)](./firestore_lite_pipelines.md#unixmillistotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixSecondsToTimestamp(expr)](./firestore_lite_pipelines.md#unixsecondstotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
| function(expression, ...) |
-| [arraySum(expression)](./firestore_lite_pipelines.md#arraysum_1138a27) | (Public Preview) Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-arraySum(field("scores"));
-
-```
- |
-| [average(expression)](./firestore_lite_pipelines.md#average_1138a27) | (Public Preview) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs.
-```typescript
-// Calculate the average age of users
-average(field("age")).as("averageAge");
-
-```
- |
-| [ceil(expression)](./firestore_lite_pipelines.md#ceil_1138a27) | (Public Preview) Creates an expression that computes the ceiling of a numeric value.
-```typescript
-// Compute the ceiling of the 'price' field.
-ceil(field("price"));
-
-```
- |
-| [collectionId(expression)](./firestore_lite_pipelines.md#collectionid_1138a27) | (Public Preview) Creates an expression that returns the collection ID from a path.
-```typescript
-// Get the collection ID from a path.
-collectionId(field("__name__"));
-
-```
- |
-| [count(expression)](./firestore_lite_pipelines.md#count_1138a27) | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression.
-```typescript
-// Count the number of items where the price is greater than 10
-count(field("price").greaterThan(10)).as("expensiveItemCount");
-
-```
- |
-| [divide(expression, value)](./firestore_lite_pipelines.md#divide_01df3cf) | (Public Preview) Creates an expression that divides an expression by a constant value.
-```typescript
-// Divide the 'value' field by 10
-divide(field("value"), 10);
-
-```
- |
-| [equal(expression, value)](./firestore_lite_pipelines.md#equal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is equal to a constant value.
-```typescript
-// Check if the 'age' field is equal to 21
-equal(field("age"), 21);
-
-```
- |
-| [equalAny(expression, values)](./firestore_lite_pipelines.md#equalany_7e759b5) | (Public Preview) Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny(field("category"), [constant("Electronics"), field("primaryType")]);
-
-```
- |
-| [equalAny(expression, arrayExpression)](./firestore_lite_pipelines.md#equalany_214ce68) | (Public Preview) Creates an expression that checks if an expression is equal to any of the provided values.
-```typescript
-// Check if the 'category' field is set to a value in the disabledCategories field
-equalAny(field("category"), field('disabledCategories'));
-
-```
- |
-| [exp(expression)](./firestore_lite_pipelines.md#exp_1138a27) | (Public Preview) Creates an expression that computes e to the power of the expression's result.
-```typescript
-// Compute e to the power of 2.
-exp(constant(2));
-
-```
- A new representing the exp of the numeric value. |
-| [greaterThan(expression, value)](./firestore_lite_pipelines.md#greaterthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than a constant value.
-```typescript
-// Check if the 'age' field is greater than 18
-greaterThan(field("age"), 18);
-
-```
- |
-| [greaterThanOrEqual(expression, value)](./firestore_lite_pipelines.md#greaterthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than or equal to a constant value.
-```typescript
-// Check if the 'quantity' field is greater than or equal to 10
-greaterThanOrEqual(field("quantity"), 10);
-
-```
- |
-| [length\_2(expression)](./firestore_lite_pipelines.md#length_2_1138a27) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes.
-```typescript
-// Get the length of the 'name' field.
-length(field("name"));
-
-// Get the number of items in the 'cart' array.
-length(field("cart"));
-
-```
- |
-| [lessThan(expression, value)](./firestore_lite_pipelines.md#lessthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than a constant value.
-```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), 30);
-
-```
- |
-| [lessThanOrEqual(expression, value)](./firestore_lite_pipelines.md#lessthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than or equal to a constant value.
-```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), 20);
-
-```
- |
-| [ln(expression)](./firestore_lite_pipelines.md#ln_1138a27) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value.
-```typescript
-// Compute the natural logarithm of the 'value' field.
-ln(field("value"));
-
-```
- |
-| [log(expression, base)](./firestore_lite_pipelines.md#log_ac183e2) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with base 10.
-log(field("value"), 10);
-
-```
- |
-| [log(expression, base)](./firestore_lite_pipelines.md#log_1894737) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with the base in the 'base' field.
-log(field("value"), field("base"));
-
-```
- |
-| [log10(expression)](./firestore_lite_pipelines.md#log10_1138a27) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value.
-```typescript
-// Compute the base-10 logarithm of the 'value' field.
-log10(field("value"));
-
-```
- |
-| [maximum(expression)](./firestore_lite_pipelines.md#maximum_1138a27) | (Public Preview) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-maximum(field("score")).as("highestScore");
-
-```
- |
-| [minimum(expression)](./firestore_lite_pipelines.md#minimum_1138a27) | (Public Preview) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs.
-```typescript
-// Find the lowest price of all products
-minimum(field("price")).as("lowestPrice");
-
-```
- |
-| [mod(expression, value)](./firestore_lite_pipelines.md#mod_01df3cf) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant.
-```typescript
-// Calculate the remainder of dividing 'field1' by 5.
-mod(field("field1"), 5);
-
-```
- |
-| [notEqual(expression, value)](./firestore_lite_pipelines.md#notequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is not equal to a constant value.
-```typescript
-// Check if the 'status' field is not equal to "completed"
-notEqual(field("status"), "completed");
-
-```
- |
-| [round(expression)](./firestore_lite_pipelines.md#round_1138a27) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number.
-```typescript
-// Round the value of the 'price' field.
-round(field("price"));
-
-```
- |
-| [round(expression, decimalPlaces)](./firestore_lite_pipelines.md#round_a3a92d0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-round(field("price"), constant(2));
-
-```
- |
+| [arraySum(expression)](./firestore_lite_pipelines.md#arraysum_1138a27) | (Public Preview) Creates an expression that computes the sum of the elements in an array. |
+| [average(expression)](./firestore_lite_pipelines.md#average_1138a27) | (Public Preview) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. |
+| [ceil(expression)](./firestore_lite_pipelines.md#ceil_1138a27) | (Public Preview) Creates an expression that computes the ceiling of a numeric value. |
+| [collectionId(expression)](./firestore_lite_pipelines.md#collectionid_1138a27) | (Public Preview) Creates an expression that returns the collection ID from a path. |
+| [count(expression)](./firestore_lite_pipelines.md#count_1138a27) | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression. |
+| [divide(expression, value)](./firestore_lite_pipelines.md#divide_01df3cf) | (Public Preview) Creates an expression that divides an expression by a constant value. |
+| [equal(expression, value)](./firestore_lite_pipelines.md#equal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is equal to a constant value. |
+| [equalAny(expression, values)](./firestore_lite_pipelines.md#equalany_7e759b5) | (Public Preview) Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions. |
+| [equalAny(expression, arrayExpression)](./firestore_lite_pipelines.md#equalany_214ce68) | (Public Preview) Creates an expression that checks if an expression is equal to any of the provided values. |
+| [exp(expression)](./firestore_lite_pipelines.md#exp_1138a27) | (Public Preview) Creates an expression that computes e to the power of the expression's result. |
+| [greaterThan(expression, value)](./firestore_lite_pipelines.md#greaterthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than a constant value. |
+| [greaterThanOrEqual(expression, value)](./firestore_lite_pipelines.md#greaterthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than or equal to a constant value. |
+| [length\_2(expression)](./firestore_lite_pipelines.md#length_2_1138a27) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
+| [lessThan(expression, value)](./firestore_lite_pipelines.md#lessthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than a constant value. |
+| [lessThanOrEqual(expression, value)](./firestore_lite_pipelines.md#lessthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than or equal to a constant value. |
+| [ln(expression)](./firestore_lite_pipelines.md#ln_1138a27) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value. |
+| [log(expression, base)](./firestore_lite_pipelines.md#log_ac183e2) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base. |
+| [log(expression, base)](./firestore_lite_pipelines.md#log_1894737) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base. |
+| [log10(expression)](./firestore_lite_pipelines.md#log10_1138a27) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value. |
+| [maximum(expression)](./firestore_lite_pipelines.md#maximum_1138a27) | (Public Preview) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. |
+| [minimum(expression)](./firestore_lite_pipelines.md#minimum_1138a27) | (Public Preview) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. |
+| [mod(expression, value)](./firestore_lite_pipelines.md#mod_01df3cf) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. |
+| [notEqual(expression, value)](./firestore_lite_pipelines.md#notequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is not equal to a constant value. |
+| [round(expression)](./firestore_lite_pipelines.md#round_1138a27) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number. |
+| [round(expression, decimalPlaces)](./firestore_lite_pipelines.md#round_a3a92d0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
| [split(expression, delimiter)](./firestore_lite_pipelines.md#split_5b5612b) | (Public Preview) Creates an expression that splits a string into an array of substrings based on the provided delimiter. |
| [split(expression, delimiter)](./firestore_lite_pipelines.md#split_5a171ed) | (Public Preview) Creates an expression that splits a string into an array of substrings based on the provided delimiter. |
-| [sqrt(expression)](./firestore_lite_pipelines.md#sqrt_1138a27) | (Public Preview) Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt(field("value"));
-
-```
- |
-| [subtract(expression, value)](./firestore_lite_pipelines.md#subtract_01df3cf) | (Public Preview) Creates an expression that subtracts a constant value from an expression.
-```typescript
-// Subtract the constant value 2 from the 'value' field
-subtract(field("value"), 2);
-
-```
- |
-| [sum(expression)](./firestore_lite_pipelines.md#sum_1138a27) | (Public Preview) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-sum(field("orderAmount")).as("totalRevenue");
-
-```
- |
+| [sqrt(expression)](./firestore_lite_pipelines.md#sqrt_1138a27) | (Public Preview) Creates an expression that computes the square root of a numeric value. |
+| [subtract(expression, value)](./firestore_lite_pipelines.md#subtract_01df3cf) | (Public Preview) Creates an expression that subtracts a constant value from an expression. |
+| [sum(expression)](./firestore_lite_pipelines.md#sum_1138a27) | (Public Preview) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. |
| [type(expression)](./firestore_lite_pipelines.md#type_1138a27) | (Public Preview) Creates an expression that returns the data type of an expression's result. |
| function(field, ...) |
-| [isAbsent(field)](./firestore_lite_pipelines.md#isabsent_0fb8cd4) | (Public Preview) Creates an expression that returns true if a field is absent. Otherwise, returns false even if the field value is null.
-```typescript
-// Check if the field `value` is absent.
-isAbsent("value");
-
-```
- |
-| [reverse(field)](./firestore_lite_pipelines.md#reverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field.
-```typescript
-// Reverse the value of the 'myString' field.
-reverse("myString");
-
-```
- |
-| [stringReverse(field)](./firestore_lite_pipelines.md#stringreverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field.
-```typescript
-// Reverse the value of the 'myString' field.
-strReverse("myString");
-
-```
- |
+| [isAbsent(field)](./firestore_lite_pipelines.md#isabsent_0fb8cd4) | (Public Preview) Creates an expression that returns true if a field is absent. Otherwise, returns false even if the field value is null. |
+| [reverse(field)](./firestore_lite_pipelines.md#reverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field. |
+| [stringReverse(field)](./firestore_lite_pipelines.md#stringreverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field. |
| [substring(field, position, length)](./firestore_lite_pipelines.md#substring_0d9573a) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
| [substring(field, position, length)](./firestore_lite_pipelines.md#substring_05cb14e) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
| function(fieldName, ...) |
| [abs(fieldName)](./firestore_lite_pipelines.md#abs_e5b0480) | (Public Preview) Creates an expression that computes the absolute value of a numeric value. |
-| [add(fieldName, second)](./firestore_lite_pipelines.md#add_b75bb8b) | (Public Preview) Creates an expression that adds a field's value to an expression.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add("quantity", field("reserve"));
-
-```
- |
-| [arrayContains(fieldName, element)](./firestore_lite_pipelines.md#arraycontains_aaace4a) | (Public Preview) Creates an expression that checks if a field's array value contains a specific element.
-```typescript
-// Check if the 'colors' array contains the value of field 'selectedColor'
-arrayContains("colors", field("selectedColor"));
-
-```
- |
-| [arrayContains(fieldName, element)](./firestore_lite_pipelines.md#arraycontains_999590f) | (Public Preview) Creates an expression that checks if a field's array value contains a specific value.
-```typescript
-// Check if the 'colors' array contains "red"
-arrayContains("colors", "red");
-
-```
- |
-| [arrayContainsAll(fieldName, values)](./firestore_lite_pipelines.md#arraycontainsall_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions.
-```typescript
-// Check if the 'tags' array contains both of the values from field 'tag1', the value "SciFi", and "Adventure"
-arrayContainsAll("tags", [field("tag1"), "SciFi", "Adventure"]);
-
-```
- |
-| [arrayContainsAll(fieldName, arrayExpression)](./firestore_lite_pipelines.md#arraycontainsall_48da8d9) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions.
-```typescript
-// Check if the 'tags' array contains both of the values from field 'tag1', the value "SciFi", and "Adventure"
-arrayContainsAll("tags", [field("tag1"), "SciFi", "Adventure"]);
-
-```
- |
-| [arrayContainsAny(fieldName, values)](./firestore_lite_pipelines.md#arraycontainsany_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements.
-```typescript
-// Check if the 'groups' array contains either the value from the 'userGroup' field
-// or the value "guest"
-arrayContainsAny("categories", [field("cate1"), "Science"]);
-
-```
- |
-| [arrayContainsAny(fieldName, values)](./firestore_lite_pipelines.md#arraycontainsany_1b4f7cd) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements.
-```typescript
-// Check if the 'groups' array contains either the value from the 'userGroup' field
-// or the value "guest"
-arrayContainsAny("categories", array([field("cate1"), "Science"]));
-
-```
- |
-| [arrayLength(fieldName)](./firestore_lite_pipelines.md#arraylength_e5b0480) | (Public Preview) Creates an expression that calculates the length of an array in a specified field.
-```typescript
-// Get the number of items in field 'cart'
-arrayLength('cart');
-
-```
- |
-| [arraySum(fieldName)](./firestore_lite_pipelines.md#arraysum_e5b0480) | (Public Preview) Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-arraySum("scores");
-
-```
- |
-| [ascending(fieldName)](./firestore_lite_pipelines.md#ascending_e5b0480) | (Public Preview) Creates an that sorts documents in ascending order based on a field.
-```typescript
-// Sort documents by the 'name' field in ascending order
-firestore.pipeline().collection("users")
- .sort(ascending("name"));
-
-```
- |
-| [average(fieldName)](./firestore_lite_pipelines.md#average_e5b0480) | (Public Preview) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs.
-```typescript
-// Calculate the average age of users
-average("age").as("averageAge");
-
-```
- |
-| [byteLength(fieldName)](./firestore_lite_pipelines.md#bytelength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.
-```typescript
-// Calculate the length of the 'myString' field in bytes.
-byteLength("myString");
-
-```
- |
-| [ceil(fieldName)](./firestore_lite_pipelines.md#ceil_e5b0480) | (Public Preview) Creates an expression that computes the ceiling of a numeric value.
-```typescript
-// Compute the ceiling of the 'price' field.
-ceil("price");
-
-```
- |
-| [charLength(fieldName)](./firestore_lite_pipelines.md#charlength_e5b0480) | (Public Preview) Creates an expression that calculates the character length of a string field in UTF8.
-```typescript
-// Get the character length of the 'name' field in UTF-8.
-strLength("name");
-
-```
- |
-| [collectionId(fieldName)](./firestore_lite_pipelines.md#collectionid_e5b0480) | (Public Preview) Creates an expression that returns the collection ID from a path.
-```typescript
-// Get the collection ID from a path.
-collectionId("__name__");
-
-```
- |
-| [concat(fieldName, second, others)](./firestore_lite_pipelines.md#concat_828272e) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
-```typescript
-// Concatenate a field with a literal string.
-concat(field("firstName"), "Doe")
-
-```
- |
-| [cosineDistance(fieldName, vector)](./firestore_lite_pipelines.md#cosinedistance_463a23e) | (Public Preview) Calculates the Cosine distance between a field's vector value and a literal vector value.
-```typescript
-// Calculate the Cosine distance between the 'location' field and a target location
-cosineDistance("location", [37.7749, -122.4194]);
-
-```
- |
-| [cosineDistance(fieldName, vectorExpression)](./firestore_lite_pipelines.md#cosinedistance_ed766a1) | (Public Preview) Calculates the Cosine distance between a field's vector value and a vector expression.
-```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-cosineDistance("userVector", field("itemVector"));
-
-```
- |
-| [count(fieldName)](./firestore_lite_pipelines.md#count_e5b0480) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the input field exists.
-```typescript
-// Count the total number of products
-count("productId").as("totalProducts");
-
-```
- |
-| [descending(fieldName)](./firestore_lite_pipelines.md#descending_e5b0480) | (Public Preview) Creates an that sorts documents in descending order based on a field.
-```typescript
-// Sort documents by the 'name' field in descending order
-firestore.pipeline().collection("users")
- .sort(descending("name"));
-
-```
- |
-| [divide(fieldName, expressions)](./firestore_lite_pipelines.md#divide_cf36e43) | (Public Preview) Creates an expression that divides a field's value by an expression.
-```typescript
-// Divide the 'total' field by the 'count' field
-divide("total", field("count"));
-
-```
- |
-| [divide(fieldName, value)](./firestore_lite_pipelines.md#divide_65e2f32) | (Public Preview) Creates an expression that divides a field's value by a constant value.
-```typescript
-// Divide the 'value' field by 10
-divide("value", 10);
-
-```
- |
-| [dotProduct(fieldName, vector)](./firestore_lite_pipelines.md#dotproduct_463a23e) | (Public Preview) Calculates the dot product between a field's vector value and a double array.
-```typescript
-// Calculate the dot product distance between a feature vector and a target vector
-dotProduct("features", [0.5, 0.8, 0.2]);
-
-```
- |
-| [dotProduct(fieldName, vectorExpression)](./firestore_lite_pipelines.md#dotproduct_ed766a1) | (Public Preview) Calculates the dot product between a field's vector value and a vector expression.
-```typescript
-// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2'
-dotProduct("docVector1", field("docVector2"));
-
-```
- |
-| [endsWith(fieldName, suffix)](./firestore_lite_pipelines.md#endswith_05ca3b0) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix.
-```typescript
-// Check if the 'filename' field ends with ".txt"
-endsWith("filename", ".txt");
-
-```
- |
-| [endsWith(fieldName, suffix)](./firestore_lite_pipelines.md#endswith_8fc0ebc) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix.
-```typescript
-// Check if the 'url' field ends with the value of the 'extension' field
-endsWith("url", field("extension"));
-
-```
- |
-| [equal(fieldName, expression)](./firestore_lite_pipelines.md#equal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is equal to an expression.
-```typescript
-// Check if the 'age' field is equal to the 'limit' field
-equal("age", field("limit"));
-
-```
- |
-| [equal(fieldName, value)](./firestore_lite_pipelines.md#equal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is equal to a constant value.
-```typescript
-// Check if the 'city' field is equal to string constant "London"
-equal("city", "London");
-
-```
- |
-| [equalAny(fieldName, values)](./firestore_lite_pipelines.md#equalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny("category", [constant("Electronics"), field("primaryType")]);
-
-```
- |
-| [equalAny(fieldName, arrayExpression)](./firestore_lite_pipelines.md#equalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny("category", ["Electronics", field("primaryType")]);
-
-```
- |
-| [euclideanDistance(fieldName, vector)](./firestore_lite_pipelines.md#euclideandistance_463a23e) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a double array.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-euclideanDistance("location", [37.7749, -122.4194]);
-
-```
- |
-| [euclideanDistance(fieldName, vectorExpression)](./firestore_lite_pipelines.md#euclideandistance_ed766a1) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a vector expression.
-```typescript
-// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
-euclideanDistance("pointA", field("pointB"));
-
-```
- |
-| [exists(fieldName)](./firestore_lite_pipelines.md#exists_e5b0480) | (Public Preview) Creates an expression that checks if a field exists.
-```typescript
-// Check if the document has a field named "phoneNumber"
-exists("phoneNumber");
-
-```
- |
-| [exp(fieldName)](./firestore_lite_pipelines.md#exp_e5b0480) | (Public Preview) Creates an expression that computes e to the power of the expression's result.
-```typescript
-// Compute e to the power of the 'value' field.
-exp('value');
-
-```
- A new representing the exp of the numeric value. |
+| [add(fieldName, second)](./firestore_lite_pipelines.md#add_b75bb8b) | (Public Preview) Creates an expression that adds a field's value to an expression. |
+| [arrayContains(fieldName, element)](./firestore_lite_pipelines.md#arraycontains_aaace4a) | (Public Preview) Creates an expression that checks if a field's array value contains a specific element. |
+| [arrayContains(fieldName, element)](./firestore_lite_pipelines.md#arraycontains_999590f) | (Public Preview) Creates an expression that checks if a field's array value contains a specific value. |
+| [arrayContainsAll(fieldName, values)](./firestore_lite_pipelines.md#arraycontainsall_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions. |
+| [arrayContainsAll(fieldName, arrayExpression)](./firestore_lite_pipelines.md#arraycontainsall_48da8d9) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions. |
+| [arrayContainsAny(fieldName, values)](./firestore_lite_pipelines.md#arraycontainsany_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements. |
+| [arrayContainsAny(fieldName, values)](./firestore_lite_pipelines.md#arraycontainsany_1b4f7cd) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements. |
+| [arrayLength(fieldName)](./firestore_lite_pipelines.md#arraylength_e5b0480) | (Public Preview) Creates an expression that calculates the length of an array in a specified field. |
+| [arraySum(fieldName)](./firestore_lite_pipelines.md#arraysum_e5b0480) | (Public Preview) Creates an expression that computes the sum of the elements in an array. |
+| [ascending(fieldName)](./firestore_lite_pipelines.md#ascending_e5b0480) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on a field. |
+| [average(fieldName)](./firestore_lite_pipelines.md#average_e5b0480) | (Public Preview) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. |
+| [byteLength(fieldName)](./firestore_lite_pipelines.md#bytelength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. |
+| [ceil(fieldName)](./firestore_lite_pipelines.md#ceil_e5b0480) | (Public Preview) Creates an expression that computes the ceiling of a numeric value. |
+| [charLength(fieldName)](./firestore_lite_pipelines.md#charlength_e5b0480) | (Public Preview) Creates an expression that calculates the character length of a string field in UTF8. |
+| [collectionId(fieldName)](./firestore_lite_pipelines.md#collectionid_e5b0480) | (Public Preview) Creates an expression that returns the collection ID from a path. |
+| [concat(fieldName, second, others)](./firestore_lite_pipelines.md#concat_828272e) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed. |
+| [cosineDistance(fieldName, vector)](./firestore_lite_pipelines.md#cosinedistance_463a23e) | (Public Preview) Calculates the Cosine distance between a field's vector value and a literal vector value. |
+| [cosineDistance(fieldName, vectorExpression)](./firestore_lite_pipelines.md#cosinedistance_ed766a1) | (Public Preview) Calculates the Cosine distance between a field's vector value and a vector expression. |
+| [count(fieldName)](./firestore_lite_pipelines.md#count_e5b0480) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the input field exists. |
+| [descending(fieldName)](./firestore_lite_pipelines.md#descending_e5b0480) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on a field. |
+| [divide(fieldName, expressions)](./firestore_lite_pipelines.md#divide_cf36e43) | (Public Preview) Creates an expression that divides a field's value by an expression. |
+| [divide(fieldName, value)](./firestore_lite_pipelines.md#divide_65e2f32) | (Public Preview) Creates an expression that divides a field's value by a constant value. |
+| [dotProduct(fieldName, vector)](./firestore_lite_pipelines.md#dotproduct_463a23e) | (Public Preview) Calculates the dot product between a field's vector value and a double array. |
+| [dotProduct(fieldName, vectorExpression)](./firestore_lite_pipelines.md#dotproduct_ed766a1) | (Public Preview) Calculates the dot product between a field's vector value and a vector expression. |
+| [endsWith(fieldName, suffix)](./firestore_lite_pipelines.md#endswith_05ca3b0) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix. |
+| [endsWith(fieldName, suffix)](./firestore_lite_pipelines.md#endswith_8fc0ebc) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix. |
+| [equal(fieldName, expression)](./firestore_lite_pipelines.md#equal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is equal to an expression. |
+| [equal(fieldName, value)](./firestore_lite_pipelines.md#equal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is equal to a constant value. |
+| [equalAny(fieldName, values)](./firestore_lite_pipelines.md#equalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. |
+| [equalAny(fieldName, arrayExpression)](./firestore_lite_pipelines.md#equalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. |
+| [euclideanDistance(fieldName, vector)](./firestore_lite_pipelines.md#euclideandistance_463a23e) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a double array. |
+| [euclideanDistance(fieldName, vectorExpression)](./firestore_lite_pipelines.md#euclideandistance_ed766a1) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a vector expression. |
+| [exists(fieldName)](./firestore_lite_pipelines.md#exists_e5b0480) | (Public Preview) Creates an expression that checks if a field exists. |
+| [exp(fieldName)](./firestore_lite_pipelines.md#exp_e5b0480) | (Public Preview) Creates an expression that computes e to the power of the expression's result. |
| [floor(fieldName)](./firestore_lite_pipelines.md#floor_e5b0480) | (Public Preview) Creates an expression that computes the floor of a numeric value. |
-| [greaterThan(fieldName, expression)](./firestore_lite_pipelines.md#greaterthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is greater than an expression.
-```typescript
-// Check if the value of field 'age' is greater than the value of field 'limit'
-greaterThan("age", field("limit"));
-
-```
- |
-| [greaterThan(fieldName, value)](./firestore_lite_pipelines.md#greaterthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than a constant value.
-```typescript
-// Check if the 'price' field is greater than 100
-greaterThan("price", 100);
-
-```
- |
-| [greaterThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#greaterthanorequal_2e16acb) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to an expression.
-```typescript
-// Check if the value of field 'age' is greater than or equal to the value of field 'limit'
-greaterThanOrEqual("age", field("limit"));
-
-```
- |
-| [greaterThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#greaterthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to a constant value.
-```typescript
-// Check if the 'score' field is greater than or equal to 80
-greaterThanOrEqual("score", 80);
-
-```
- |
-| [length\_2(fieldName)](./firestore_lite_pipelines.md#length_2_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes.
-```typescript
-// Get the length of the 'name' field.
-length("name");
-
-// Get the number of items in the 'cart' array.
-length("cart");
-
-```
- |
-| [lessThan(fieldName, expression)](./firestore_lite_pipelines.md#lessthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than an expression.
-```typescript
-// Check if the 'age' field is less than the 'limit' field
-lessThan("age", field("limit"));
-
-```
- |
-| [lessThan(fieldName, value)](./firestore_lite_pipelines.md#lessthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than a constant value.
-```typescript
-// Check if the 'price' field is less than 50
-lessThan("price", 50);
-
-```
- |
-| [lessThanOrEqual(fieldName, expression)](./firestore_lite_pipelines.md#lessthanorequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to an expression.
-```typescript
-// Check if the 'quantity' field is less than or equal to the 'limit' field
-lessThan("quantity", field("limit"));
-
-```
- |
-| [lessThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#lessthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to a constant value.
-```typescript
-// Check if the 'score' field is less than or equal to 70
-lessThan("score", 70);
-
-```
- |
-| [like(fieldName, pattern)](./firestore_lite_pipelines.md#like_67f7432) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like("title", "%guide%");
-
-```
- |
-| [like(fieldName, pattern)](./firestore_lite_pipelines.md#like_cb1318d) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like("title", field("pattern"));
-
-```
- |
-| [ln(fieldName)](./firestore_lite_pipelines.md#ln_e5b0480) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value.
-```typescript
-// Compute the natural logarithm of the 'value' field.
-ln("value");
-
-```
- |
-| [log(fieldName, base)](./firestore_lite_pipelines.md#log_a89e21b) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with base 10.
-log("value", 10);
-
-```
- |
-| [log(fieldName, base)](./firestore_lite_pipelines.md#log_805b11f) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with the base in the 'base' field.
-log("value", field("base"));
-
-```
- |
-| [log10(fieldName)](./firestore_lite_pipelines.md#log10_e5b0480) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value.
-```typescript
-// Compute the base-10 logarithm of the 'value' field.
-log10("value");
-
-```
- |
-| [logicalMaximum(fieldName, second, others)](./firestore_lite_pipelines.md#logicalmaximum_828272e) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the largest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMaximum("field1", field("field2"), 1000);
-
-```
- |
-| [logicalMinimum(fieldName, second, others)](./firestore_lite_pipelines.md#logicalminimum_828272e) | (Public Preview) Creates an expression that returns the smallest value between a field's value and other input expressions or literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the smallest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMinimum("field1", field("field2"), 1000);
-
-```
- |
-| [mapGet(fieldName, subField)](./firestore_lite_pipelines.md#mapget_06663cf) | (Public Preview) Accesses a value from a map (object) field using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-mapGet("address", "city");
-
-```
- |
-| [maximum(fieldName)](./firestore_lite_pipelines.md#maximum_e5b0480) | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-maximum("score").as("highestScore");
-
-```
- |
-| [minimum(fieldName)](./firestore_lite_pipelines.md#minimum_e5b0480) | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs.
-```typescript
-// Find the lowest price of all products
-minimum("price").as("lowestPrice");
-
-```
- |
-| [mod(fieldName, expression)](./firestore_lite_pipelines.md#mod_1e91657) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression.
-```typescript
-// Calculate the remainder of dividing 'field1' by 'field2'.
-mod("field1", field("field2"));
-
-```
- |
-| [mod(fieldName, value)](./firestore_lite_pipelines.md#mod_65e2f32) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant.
-```typescript
-// Calculate the remainder of dividing 'field1' by 5.
-mod("field1", 5);
-
-```
- |
-| [multiply(fieldName, second)](./firestore_lite_pipelines.md#multiply_b75bb8b) | (Public Preview) Creates an expression that multiplies a field's value by an expression.
-```typescript
-// Multiply the 'quantity' field by the 'price' field
-multiply("quantity", field("price"));
-
-```
- |
-| [notEqual(fieldName, expression)](./firestore_lite_pipelines.md#notequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is not equal to an expression.
-```typescript
-// Check if the 'status' field is not equal to the value of 'expectedStatus'
-notEqual("status", field("expectedStatus"));
-
-```
- |
-| [notEqual(fieldName, value)](./firestore_lite_pipelines.md#notequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is not equal to a constant value.
-```typescript
-// Check if the 'country' field is not equal to "USA"
-notEqual("country", "USA");
-
-```
- |
-| [notEqualAny(fieldName, values)](./firestore_lite_pipelines.md#notequalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny("status", [constant("pending"), field("rejectedStatus")]);
-
-```
- |
-| [notEqualAny(fieldName, arrayExpression)](./firestore_lite_pipelines.md#notequalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the values in the evaluated expression.
-```typescript
-// Check if the 'status' field is not equal to any value in the field 'rejectedStatuses'
-notEqualAny("status", field("rejectedStatuses"));
-
-```
- |
-| [regexContains(fieldName, pattern)](./firestore_lite_pipelines.md#regexcontains_67f7432) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains("description", "(?i)example");
-
-```
- |
-| [regexContains(fieldName, pattern)](./firestore_lite_pipelines.md#regexcontains_cb1318d) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains("description", field("pattern"));
-
-```
- |
-| [regexMatch(fieldName, pattern)](./firestore_lite_pipelines.md#regexmatch_67f7432) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
-
-```
- |
-| [regexMatch(fieldName, pattern)](./firestore_lite_pipelines.md#regexmatch_cb1318d) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch("email", field("pattern"));
-
-```
- |
-| [round(fieldName)](./firestore_lite_pipelines.md#round_e5b0480) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number.
-```typescript
-// Round the value of the 'price' field.
-round("price");
-
-```
- |
-| [round(fieldName, decimalPlaces)](./firestore_lite_pipelines.md#round_07d0cf0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-round("price", 2);
-
-```
- |
+| [greaterThan(fieldName, expression)](./firestore_lite_pipelines.md#greaterthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is greater than an expression. |
+| [greaterThan(fieldName, value)](./firestore_lite_pipelines.md#greaterthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than a constant value. |
+| [greaterThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#greaterthanorequal_2e16acb) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to an expression. |
+| [greaterThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#greaterthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to a constant value. |
+| [length\_2(fieldName)](./firestore_lite_pipelines.md#length_2_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
+| [lessThan(fieldName, expression)](./firestore_lite_pipelines.md#lessthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than an expression. |
+| [lessThan(fieldName, value)](./firestore_lite_pipelines.md#lessthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than a constant value. |
+| [lessThanOrEqual(fieldName, expression)](./firestore_lite_pipelines.md#lessthanorequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to an expression. |
+| [lessThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#lessthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to a constant value. |
+| [like(fieldName, pattern)](./firestore_lite_pipelines.md#like_67f7432) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field. |
+| [like(fieldName, pattern)](./firestore_lite_pipelines.md#like_cb1318d) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field. |
+| [ln(fieldName)](./firestore_lite_pipelines.md#ln_e5b0480) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value. |
+| [log(fieldName, base)](./firestore_lite_pipelines.md#log_a89e21b) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base. |
+| [log(fieldName, base)](./firestore_lite_pipelines.md#log_805b11f) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base. |
+| [log10(fieldName)](./firestore_lite_pipelines.md#log10_e5b0480) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value. |
+| [logicalMaximum(fieldName, second, others)](./firestore_lite_pipelines.md#logicalmaximum_828272e) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering. |
+| [logicalMinimum(fieldName, second, others)](./firestore_lite_pipelines.md#logicalminimum_828272e) | (Public Preview) Creates an expression that returns the smallest value between a field's value and other input expressions or literal values. Based on Firestore's value type ordering. |
+| [mapGet(fieldName, subField)](./firestore_lite_pipelines.md#mapget_06663cf) | (Public Preview) Accesses a value from a map (object) field using the provided key. |
+| [maximum(fieldName)](./firestore_lite_pipelines.md#maximum_e5b0480) | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. |
+| [minimum(fieldName)](./firestore_lite_pipelines.md#minimum_e5b0480) | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. |
+| [mod(fieldName, expression)](./firestore_lite_pipelines.md#mod_1e91657) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. |
+| [mod(fieldName, value)](./firestore_lite_pipelines.md#mod_65e2f32) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. |
+| [multiply(fieldName, second)](./firestore_lite_pipelines.md#multiply_b75bb8b) | (Public Preview) Creates an expression that multiplies a field's value by an expression. |
+| [notEqual(fieldName, expression)](./firestore_lite_pipelines.md#notequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is not equal to an expression. |
+| [notEqual(fieldName, value)](./firestore_lite_pipelines.md#notequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is not equal to a constant value. |
+| [notEqualAny(fieldName, values)](./firestore_lite_pipelines.md#notequalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. |
+| [notEqualAny(fieldName, arrayExpression)](./firestore_lite_pipelines.md#notequalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the values in the evaluated expression. |
+| [regexContains(fieldName, pattern)](./firestore_lite_pipelines.md#regexcontains_67f7432) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring. |
+| [regexContains(fieldName, pattern)](./firestore_lite_pipelines.md#regexcontains_cb1318d) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring. |
+| [regexMatch(fieldName, pattern)](./firestore_lite_pipelines.md#regexmatch_67f7432) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression. |
+| [regexMatch(fieldName, pattern)](./firestore_lite_pipelines.md#regexmatch_cb1318d) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression. |
+| [round(fieldName)](./firestore_lite_pipelines.md#round_e5b0480) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number. |
+| [round(fieldName, decimalPlaces)](./firestore_lite_pipelines.md#round_07d0cf0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
| [split(fieldName, delimiter)](./firestore_lite_pipelines.md#split_2cfdd37) | (Public Preview) Creates an expression that splits the value of a field on the provided delimiter. |
-| [split(fieldName, delimiter)](./firestore_lite_pipelines.md#split_f4fe06a) | (Public Preview) Creates an expression that splits the value of a field on the provided delimiter. |
-| [sqrt(fieldName)](./firestore_lite_pipelines.md#sqrt_e5b0480) | (Public Preview) Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt("value");
-
-```
- |
-| [startsWith(fieldName, prefix)](./firestore_lite_pipelines.md#startswith_89325cc) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix.
-```typescript
-// Check if the 'name' field starts with "Mr."
-startsWith("name", "Mr.");
-
-```
- |
-| [startsWith(fieldName, prefix)](./firestore_lite_pipelines.md#startswith_266c338) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix.
-```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-startsWith("fullName", field("firstName"));
-
-```
- |
-| [stringConcat(fieldName, secondString, otherStrings)](./firestore_lite_pipelines.md#stringconcat_d80077e) | (Public Preview) Creates an expression that concatenates string functions, fields or constants together.
-```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-stringConcat("firstName", " ", field("lastName"));
-
-```
- |
-| [stringContains(fieldName, substring)](./firestore_lite_pipelines.md#stringcontains_5b94cfe) | (Public Preview) Creates an expression that checks if a string field contains a specified substring.
-```typescript
-// Check if the 'description' field contains "example".
-stringContains("description", "example");
-
-```
- |
-| [stringContains(fieldName, substring)](./firestore_lite_pipelines.md#stringcontains_ac3ba47) | (Public Preview) Creates an expression that checks if a string field contains a substring specified by an expression.
-```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-stringContains("description", field("keyword"));
-
-```
- |
-| [subtract(fieldName, expression)](./firestore_lite_pipelines.md#subtract_1e91657) | (Public Preview) Creates an expression that subtracts an expression from a field's value.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract("price", field("discount"));
-
-```
- |
-| [subtract(fieldName, value)](./firestore_lite_pipelines.md#subtract_65e2f32) | (Public Preview) Creates an expression that subtracts a constant value from a field's value.
-```typescript
-// Subtract 20 from the value of the 'total' field
-subtract("total", 20);
-
-```
- |
-| [sum(fieldName)](./firestore_lite_pipelines.md#sum_e5b0480) | (Public Preview) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-sum("orderAmount").as("totalRevenue");
-
-```
- |
-| [timestampAdd(fieldName, unit, amount)](./firestore_lite_pipelines.md#timestampadd_341fe7d) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp represented by a field.
-```typescript
-// Add 1 day to the 'timestamp' field.
-timestampAdd("timestamp", "day", 1);
-
-```
- |
-| [timestampSubtract(fieldName, unit, amount)](./firestore_lite_pipelines.md#timestampsubtract_341fe7d) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field.
-```typescript
-// Subtract 1 day from the 'timestamp' field.
-timestampSubtract("timestamp", "day", 1);
-
-```
- |
-| [timestampToUnixMicros(fieldName)](./firestore_lite_pipelines.md#timestamptounixmicros_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros("timestamp");
-
-```
- |
-| [timestampToUnixMillis(fieldName)](./firestore_lite_pipelines.md#timestamptounixmillis_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis("timestamp");
-
-```
- |
-| [timestampToUnixSeconds(fieldName)](./firestore_lite_pipelines.md#timestamptounixseconds_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds("timestamp");
-
-```
- |
-| [timestampTruncate(fieldName, granularity, timezone)](./firestore_lite_pipelines.md#timestamptruncate_b6c7512) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
-| [timestampTruncate(fieldName, granularity, timezone)](./firestore_lite_pipelines.md#timestamptruncate_ed83d46) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
-| [toLower(fieldName)](./firestore_lite_pipelines.md#tolower_e5b0480) | (Public Preview) Creates an expression that converts a string field to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-toLower("name");
-
-```
- |
-| [toUpper(fieldName)](./firestore_lite_pipelines.md#toupper_e5b0480) | (Public Preview) Creates an expression that converts a string field to uppercase.
-```typescript
-// Convert the 'title' field to uppercase
-toUpper("title");
-
-```
- |
-| [trim(fieldName, valueToTrim)](./firestore_lite_pipelines.md#trim_c9f90ee) | (Public Preview) Creates an expression that removes leading and trailing whitespace from a string or byte array.
-```typescript
-// Trim whitespace from the 'userInput' field
-trim("userInput");
-
-// Trim quotes from the 'userInput' field
-trim("userInput", '"');
-
-```
- |
-| [type(fieldName)](./firestore_lite_pipelines.md#type_e5b0480) | (Public Preview) Creates an expression that returns the data type of the data in the specified field. |
-| [unixMicrosToTimestamp(fieldName)](./firestore_lite_pipelines.md#unixmicrostotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp("microseconds");
-
-```
- |
-| [unixMillisToTimestamp(fieldName)](./firestore_lite_pipelines.md#unixmillistotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp("milliseconds");
-
-```
- |
-| [unixSecondsToTimestamp(fieldName)](./firestore_lite_pipelines.md#unixsecondstotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp("seconds");
-
-```
- |
-| [vectorLength(fieldName)](./firestore_lite_pipelines.md#vectorlength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector represented by a field.
-```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength("embedding");
-
-```
- |
-| function(first, ...) |
-| [add(first, second)](./firestore_lite_pipelines.md#add_846ca1b) | (Public Preview) Creates an expression that adds two expressions together.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add(field("quantity"), field("reserve"));
-
-```
- |
-| [and(first, second, more)](./firestore_lite_pipelines.md#and_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'AND' operation on multiple filter conditions.
-```typescript
-// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND
-// the 'status' field is "active"
-const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
-
-```
- |
-| [concat(first, second, others)](./firestore_lite_pipelines.md#concat_83be015) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
-```typescript
-// Concatenate the 'firstName' and 'lastName' fields with a space in between.
-concat(field("firstName"), " ", field("lastName"))
-
-```
- |
-| [logicalMaximum(first, second, others)](./firestore_lite_pipelines.md#logicalmaximum_83be015) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the largest value between the 'field1' field, the 'field2' field,
-// and 1000
-logicalMaximum(field("field1"), field("field2"), 1000);
-
-```
- |
-| [logicalMinimum(first, second, others)](./firestore_lite_pipelines.md#logicalminimum_83be015) | (Public Preview) Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the smallest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMinimum(field("field1"), field("field2"), 1000);
-
-```
- |
-| [multiply(first, second)](./firestore_lite_pipelines.md#multiply_846ca1b) | (Public Preview) Creates an expression that multiplies two expressions together.
-```typescript
-// Multiply the 'quantity' field by the 'price' field
-multiply(field("quantity"), field("price"));
-
-```
- |
-| [or(first, second, more)](./firestore_lite_pipelines.md#or_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'OR' operation on multiple filter conditions.
-```typescript
-// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR
-// the 'status' field is "active"
-const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
-
-```
- |
-| [xor(first, second, additionalConditions)](./firestore_lite_pipelines.md#xor_8197113) | (Public Preview) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions.
-```typescript
-// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London",
-// or 'status' is "active".
-const condition = xor(
- greaterThan("age", 18),
- equal("city", "London"),
- equal("status", "active"));
-
-```
- |
-| function(firstArray, ...) |
-| [arrayConcat(firstArray, secondArray, otherArrays)](./firestore_lite_pipelines.md#arrayconcat_c00d5d7) | (Public Preview) Creates an expression that concatenates an array expression with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat(field("items"), [field("newItems"), field("otherItems")]);
-
-```
- |
-| function(firstArrayField, ...) |
-| [arrayConcat(firstArrayField, secondArray, otherArrays)](./firestore_lite_pipelines.md#arrayconcat_f92063d) | (Public Preview) Creates an expression that concatenates a field's array value with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat("items", [field("newItems"), field("otherItems")]);
-
-```
- |
-| function(firstMap, ...) |
-| [mapMerge(firstMap, secondMap, otherMaps)](./firestore_lite_pipelines.md#mapmerge_cfe77ce) | (Public Preview) Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge(field('settings'), { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
- |
-| function(firstString, ...) |
-| [stringConcat(firstString, secondString, otherStrings)](./firestore_lite_pipelines.md#stringconcat_8a8d1b6) | (Public Preview) Creates an expression that concatenates string expressions together.
-```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-stringConcat(field("firstName"), " ", field("lastName"));
-
-```
- |
-| function(ifExpr, ...) |
-| [ifAbsent(ifExpr, elseExpr)](./firestore_lite_pipelines.md#ifabsent_0e6d161) | (Public Preview) Creates an expression that returns the elseExpr argument if ifExpr is absent, else return the result of the ifExpr argument evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent(field("optional_field"), constant("default_value"))
-
-```
- |
-| [ifAbsent(ifExpr, elseValue)](./firestore_lite_pipelines.md#ifabsent_c34e5ed) | (Public Preview) Creates an expression that returns the elseValue argument if ifExpr is absent, else return the result of the ifExpr argument evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent(field("optional_field"), "default_value")
-
-```
- |
-| function(ifFieldName, ...) |
-| [ifAbsent(ifFieldName, elseExpr)](./firestore_lite_pipelines.md#ifabsent_e6dabea) | (Public Preview) Creates an expression that returns the elseExpr argument if ifFieldName is absent, else return the value of the field.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns the value of
-// 'default_field' if 'optional_field' is absent.
-ifAbsent("optional_field", field("default_field"))
-
-```
- |
-| [ifAbsent(ifFieldName, elseValue)](./firestore_lite_pipelines.md#ifabsent_d8f2823) | (Public Preview) Creates an expression that returns the elseValue argument if ifFieldName is absent, else return the value of the field.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent("optional_field", "default_value")
-
-```
- |
-| function(input, ...) |
-| [substring(input, position, length)](./firestore_lite_pipelines.md#substring_e6e0aa3) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
-| [substring(input, position, length)](./firestore_lite_pipelines.md#substring_ab56dc6) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
-| function(left, ...) |
-| [divide(left, right)](./firestore_lite_pipelines.md#divide_b3c3382) | (Public Preview) Creates an expression that divides two expressions.
-```typescript
-// Divide the 'total' field by the 'count' field
-divide(field("total"), field("count"));
-
-```
- |
-| [equal(left, right)](./firestore_lite_pipelines.md#equal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are equal.
-```typescript
-// Check if the 'age' field is equal to an expression
-equal(field("age"), field("minAge").add(10));
-
-```
- |
-| [greaterThan(left, right)](./firestore_lite_pipelines.md#greaterthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than the second expression.
-```typescript
-// Check if the 'age' field is greater than 18
-greaterThan(field("age"), Constant(9).add(9));
-
-```
- |
-| [greaterThanOrEqual(left, right)](./firestore_lite_pipelines.md#greaterthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than or equal to the second expression.
-```typescript
-// Check if the 'quantity' field is greater than or equal to the field "threshold"
-greaterThanOrEqual(field("quantity"), field("threshold"));
-
-```
- |
-| [lessThan(left, right)](./firestore_lite_pipelines.md#lessthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than the second expression.
-```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), field("limit"));
-
-```
- |
-| [lessThanOrEqual(left, right)](./firestore_lite_pipelines.md#lessthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than or equal to the second expression.
-```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), field("limit"));
-
-```
- |
-| [mod(left, right)](./firestore_lite_pipelines.md#mod_b3c3382) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing two expressions.
-```typescript
-// Calculate the remainder of dividing 'field1' by 'field2'.
-mod(field("field1"), field("field2"));
-
-```
- |
-| [notEqual(left, right)](./firestore_lite_pipelines.md#notequal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are not equal.
-```typescript
-// Check if the 'status' field is not equal to field 'finalState'
-notEqual(field("status"), field("finalState"));
-
-```
- |
-| [subtract(left, right)](./firestore_lite_pipelines.md#subtract_b3c3382) | (Public Preview) Creates an expression that subtracts two expressions.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract(field("price"), field("discount"));
-
-```
- |
-| function(mapExpr, ...) |
-| [mapRemove(mapExpr, key)](./firestore_lite_pipelines.md#mapremove_23c7d51) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression.
-```
-// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), 'baz');
-
-```
- |
-| [mapRemove(mapExpr, keyExpr)](./firestore_lite_pipelines.md#mapremove_9fbcaa3) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression.
-```
-// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
-
-```
- |
-| function(mapExpression, ...) |
-| [mapGet(mapExpression, subField)](./firestore_lite_pipelines.md#mapget_688c050) | (Public Preview) Accesses a value from a map (object) expression using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-mapGet(field("address"), "city");
-
-```
- |
-| function(mapField, ...) |
-| [mapMerge(mapField, secondMap, otherMaps)](./firestore_lite_pipelines.md#mapmerge_70a564b) | (Public Preview) Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge('settings', { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
- |
-| [mapRemove(mapField, key)](./firestore_lite_pipelines.md#mapremove_bd5726e) | (Public Preview) Creates an expression that removes a key from the map at the specified field name.
-```
-// Removes the key 'city' field from the map in the address field of the input document.
-mapRemove('address', 'city');
-
-```
- |
-| [mapRemove(mapField, keyExpr)](./firestore_lite_pipelines.md#mapremove_8406d13) | (Public Preview) Creates an expression that removes a key from the map at the specified field name.
-```
-// Removes the key 'city' field from the map in the address field of the input document.
-mapRemove('address', constant('city'));
-
-```
- |
-| function(name, ...) |
-| [field(name)](./firestore_lite_pipelines.md#field_1eaaff4) | (Public Preview) Creates a instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city").
-```typescript
-// Create a Field instance for the 'title' field
-const titleField = field("title");
-
-// Create a Field instance for a nested field 'author.firstName'
-const authorFirstNameField = field("author.firstName");
-
-```
- |
-| function(path, ...) |
-| [field(path)](./firestore_lite_pipelines.md#field_34ee07d) | (Public Preview) Creates a instance representing the field at the given path. |
-| function(pipeline, ...) |
-| [execute(pipeline)](./firestore_lite_pipelines.md#execute_01df620) | (Public Preview) Executes this pipeline and returns a Promise to represent the asynchronous operation.The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.The pipeline results are returned as a that contains a list of objects. Each typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:
Example:
-```typescript
-const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
- .where(gt(field("rating"), 4.5))
- .select("title", "author", "rating"));
-
-const results: PipelineResults = snapshot.results;
-
-```
- |
-| function(stringExpression, ...) |
-| [charLength(stringExpression)](./firestore_lite_pipelines.md#charlength_c25a54a) | (Public Preview) Creates an expression that calculates the character length of a string expression in UTF-8.
-```typescript
-// Get the character length of the 'name' field in UTF-8.
-strLength(field("name"));
-
-```
- |
-| [endsWith(stringExpression, suffix)](./firestore_lite_pipelines.md#endswith_0a0b889) | (Public Preview) Creates an expression that checks if a string expression ends with a given postfix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr."
-endsWith(field("fullName"), "Jr.");
-
-```
- |
-| [endsWith(stringExpression, suffix)](./firestore_lite_pipelines.md#endswith_13aee0d) | (Public Preview) Creates an expression that checks if a string expression ends with a given postfix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr."
-endsWith(field("fullName"), constant("Jr."));
-
-```
- |
-| [like(stringExpression, pattern)](./firestore_lite_pipelines.md#like_a84c581) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like(field("title"), "%guide%");
-
-```
- |
-| [like(stringExpression, pattern)](./firestore_lite_pipelines.md#like_b534848) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like(field("title"), field("pattern"));
-
-```
- |
-| [regexContains(stringExpression, pattern)](./firestore_lite_pipelines.md#regexcontains_a84c581) | (Public Preview) Creates an expression that checks if a string expression contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains(field("description"), "(?i)example");
-
-```
- |
-| [regexContains(stringExpression, pattern)](./firestore_lite_pipelines.md#regexcontains_b534848) | (Public Preview) Creates an expression that checks if a string expression contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains(field("description"), field("pattern"));
-
-```
- |
-| [regexMatch(stringExpression, pattern)](./firestore_lite_pipelines.md#regexmatch_a84c581) | (Public Preview) Creates an expression that checks if a string expression matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch(field("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
-
-```
- |
-| [regexMatch(stringExpression, pattern)](./firestore_lite_pipelines.md#regexmatch_b534848) | (Public Preview) Creates an expression that checks if a string expression matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch(field("email"), field("pattern"));
-
-```
- |
-| [reverse(stringExpression)](./firestore_lite_pipelines.md#reverse_c25a54a) | (Public Preview) Creates an expression that reverses a string.
-```typescript
-// Reverse the value of the 'myString' field.
-reverse(field("myString"));
-
-```
- |
-| [startsWith(stringExpression, prefix)](./firestore_lite_pipelines.md#startswith_75c3dbb) | (Public Preview) Creates an expression that checks if a string expression starts with a given prefix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr."
-startsWith(field("fullName"), "Mr.");
-
-```
- |
-| [startsWith(stringExpression, prefix)](./firestore_lite_pipelines.md#startswith_52f218a) | (Public Preview) Creates an expression that checks if a string expression starts with a given prefix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr."
-startsWith(field("fullName"), field("prefix"));
-
-```
- |
-| [stringContains(stringExpression, substring)](./firestore_lite_pipelines.md#stringcontains_3e9ff32) | (Public Preview) Creates an expression that checks if a string expression contains a specified substring.
-```typescript
-// Check if the 'description' field contains "example".
-stringContains(field("description"), "example");
-
-```
- |
-| [stringContains(stringExpression, substring)](./firestore_lite_pipelines.md#stringcontains_cc6ee02) | (Public Preview) Creates an expression that checks if a string expression contains a substring specified by another expression.
-```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-stringContains(field("description"), field("keyword"));
-
-```
- |
-| [stringReverse(stringExpression)](./firestore_lite_pipelines.md#stringreverse_c25a54a) | (Public Preview) Creates an expression that reverses a string.
-```typescript
-// Reverse the value of the 'myString' field.
-strReverse(field("myString"));
-
-```
- |
-| [toLower(stringExpression)](./firestore_lite_pipelines.md#tolower_c25a54a) | (Public Preview) Creates an expression that converts a string expression to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-toLower(field("name"));
-
-```
- |
-| [toUpper(stringExpression)](./firestore_lite_pipelines.md#toupper_c25a54a) | (Public Preview) Creates an expression that converts a string expression to uppercase.
-```typescript
-// Convert the 'title' field to uppercase
-toUppercase(field("title"));
-
-```
- |
-| [trim(stringExpression, valueToTrim)](./firestore_lite_pipelines.md#trim_dd54322) | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array expression.
-```typescript
-// Trim whitespace from the 'userInput' field
-trim(field("userInput"));
-
-// Trim quotes from the 'userInput' field
-trim(field("userInput"), '"');
-
-```
- |
+| [split(fieldName, delimiter)](./firestore_lite_pipelines.md#split_f4fe06a) | (Public Preview) Creates an expression that splits the value of a field on the provided delimiter. |
+| [sqrt(fieldName)](./firestore_lite_pipelines.md#sqrt_e5b0480) | (Public Preview) Creates an expression that computes the square root of a numeric value. |
+| [startsWith(fieldName, prefix)](./firestore_lite_pipelines.md#startswith_89325cc) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix. |
+| [startsWith(fieldName, prefix)](./firestore_lite_pipelines.md#startswith_266c338) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix. |
+| [stringConcat(fieldName, secondString, otherStrings)](./firestore_lite_pipelines.md#stringconcat_d80077e) | (Public Preview) Creates an expression that concatenates string functions, fields or constants together. |
+| [stringContains(fieldName, substring)](./firestore_lite_pipelines.md#stringcontains_5b94cfe) | (Public Preview) Creates an expression that checks if a string field contains a specified substring. |
+| [stringContains(fieldName, substring)](./firestore_lite_pipelines.md#stringcontains_ac3ba47) | (Public Preview) Creates an expression that checks if a string field contains a substring specified by an expression. |
+| [subtract(fieldName, expression)](./firestore_lite_pipelines.md#subtract_1e91657) | (Public Preview) Creates an expression that subtracts an expression from a field's value. |
+| [subtract(fieldName, value)](./firestore_lite_pipelines.md#subtract_65e2f32) | (Public Preview) Creates an expression that subtracts a constant value from a field's value. |
+| [sum(fieldName)](./firestore_lite_pipelines.md#sum_e5b0480) | (Public Preview) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. |
+| [timestampAdd(fieldName, unit, amount)](./firestore_lite_pipelines.md#timestampadd_341fe7d) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp represented by a field. |
+| [timestampSubtract(fieldName, unit, amount)](./firestore_lite_pipelines.md#timestampsubtract_341fe7d) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. |
+| [timestampToUnixMicros(fieldName)](./firestore_lite_pipelines.md#timestamptounixmicros_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixMillis(fieldName)](./firestore_lite_pipelines.md#timestamptounixmillis_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixSeconds(fieldName)](./firestore_lite_pipelines.md#timestamptounixseconds_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampTruncate(fieldName, granularity, timezone)](./firestore_lite_pipelines.md#timestamptruncate_b6c7512) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
+| [timestampTruncate(fieldName, granularity, timezone)](./firestore_lite_pipelines.md#timestamptruncate_ed83d46) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
+| [toLower(fieldName)](./firestore_lite_pipelines.md#tolower_e5b0480) | (Public Preview) Creates an expression that converts a string field to lowercase. |
+| [toUpper(fieldName)](./firestore_lite_pipelines.md#toupper_e5b0480) | (Public Preview) Creates an expression that converts a string field to uppercase. |
+| [trim(fieldName, valueToTrim)](./firestore_lite_pipelines.md#trim_c9f90ee) | (Public Preview) Creates an expression that removes leading and trailing whitespace from a string or byte array. |
+| [type(fieldName)](./firestore_lite_pipelines.md#type_e5b0480) | (Public Preview) Creates an expression that returns the data type of the data in the specified field. |
+| [unixMicrosToTimestamp(fieldName)](./firestore_lite_pipelines.md#unixmicrostotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixMillisToTimestamp(fieldName)](./firestore_lite_pipelines.md#unixmillistotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixSecondsToTimestamp(fieldName)](./firestore_lite_pipelines.md#unixsecondstotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [vectorLength(fieldName)](./firestore_lite_pipelines.md#vectorlength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector represented by a field. |
+| function(first, ...) |
+| [add(first, second)](./firestore_lite_pipelines.md#add_846ca1b) | (Public Preview) Creates an expression that adds two expressions together. |
+| [and(first, second, more)](./firestore_lite_pipelines.md#and_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'AND' operation on multiple filter conditions. |
+| [concat(first, second, others)](./firestore_lite_pipelines.md#concat_83be015) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed. |
+| [logicalMaximum(first, second, others)](./firestore_lite_pipelines.md#logicalmaximum_83be015) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering. |
+| [logicalMinimum(first, second, others)](./firestore_lite_pipelines.md#logicalminimum_83be015) | (Public Preview) Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering. |
+| [multiply(first, second)](./firestore_lite_pipelines.md#multiply_846ca1b) | (Public Preview) Creates an expression that multiplies two expressions together. |
+| [or(first, second, more)](./firestore_lite_pipelines.md#or_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'OR' operation on multiple filter conditions. |
+| [xor(first, second, additionalConditions)](./firestore_lite_pipelines.md#xor_8197113) | (Public Preview) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions. |
+| function(firstArray, ...) |
+| [arrayConcat(firstArray, secondArray, otherArrays)](./firestore_lite_pipelines.md#arrayconcat_c00d5d7) | (Public Preview) Creates an expression that concatenates an array expression with other arrays. |
+| function(firstArrayField, ...) |
+| [arrayConcat(firstArrayField, secondArray, otherArrays)](./firestore_lite_pipelines.md#arrayconcat_f92063d) | (Public Preview) Creates an expression that concatenates a field's array value with other arrays. |
+| function(firstMap, ...) |
+| [mapMerge(firstMap, secondMap, otherMaps)](./firestore_lite_pipelines.md#mapmerge_cfe77ce) | (Public Preview) Creates an expression that merges multiple map values. |
+| function(firstString, ...) |
+| [stringConcat(firstString, secondString, otherStrings)](./firestore_lite_pipelines.md#stringconcat_8a8d1b6) | (Public Preview) Creates an expression that concatenates string expressions together. |
+| function(ifExpr, ...) |
+| [ifAbsent(ifExpr, elseExpr)](./firestore_lite_pipelines.md#ifabsent_0e6d161) | (Public Preview) Creates an expression that returns the elseExpr argument if ifExpr is absent, else return the result of the ifExpr argument evaluation. |
+| [ifAbsent(ifExpr, elseValue)](./firestore_lite_pipelines.md#ifabsent_c34e5ed) | (Public Preview) Creates an expression that returns the elseValue argument if ifExpr is absent, else return the result of the ifExpr argument evaluation. |
+| function(ifFieldName, ...) |
+| [ifAbsent(ifFieldName, elseExpr)](./firestore_lite_pipelines.md#ifabsent_e6dabea) | (Public Preview) Creates an expression that returns the elseExpr argument if ifFieldName is absent, else return the value of the field. |
+| [ifAbsent(ifFieldName, elseValue)](./firestore_lite_pipelines.md#ifabsent_d8f2823) | (Public Preview) Creates an expression that returns the elseValue argument if ifFieldName is absent, else return the value of the field. |
+| function(input, ...) |
+| [substring(input, position, length)](./firestore_lite_pipelines.md#substring_e6e0aa3) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
+| [substring(input, position, length)](./firestore_lite_pipelines.md#substring_ab56dc6) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
+| function(left, ...) |
+| [divide(left, right)](./firestore_lite_pipelines.md#divide_b3c3382) | (Public Preview) Creates an expression that divides two expressions. |
+| [equal(left, right)](./firestore_lite_pipelines.md#equal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are equal. |
+| [greaterThan(left, right)](./firestore_lite_pipelines.md#greaterthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than the second expression. |
+| [greaterThanOrEqual(left, right)](./firestore_lite_pipelines.md#greaterthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than or equal to the second expression. |
+| [lessThan(left, right)](./firestore_lite_pipelines.md#lessthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than the second expression. |
+| [lessThanOrEqual(left, right)](./firestore_lite_pipelines.md#lessthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than or equal to the second expression. |
+| [mod(left, right)](./firestore_lite_pipelines.md#mod_b3c3382) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing two expressions. |
+| [notEqual(left, right)](./firestore_lite_pipelines.md#notequal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are not equal. |
+| [subtract(left, right)](./firestore_lite_pipelines.md#subtract_b3c3382) | (Public Preview) Creates an expression that subtracts two expressions. |
+| function(mapExpr, ...) |
+| [mapRemove(mapExpr, key)](./firestore_lite_pipelines.md#mapremove_23c7d51) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression. |
+| [mapRemove(mapExpr, keyExpr)](./firestore_lite_pipelines.md#mapremove_9fbcaa3) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression. |
+| function(mapExpression, ...) |
+| [mapGet(mapExpression, subField)](./firestore_lite_pipelines.md#mapget_688c050) | (Public Preview) Accesses a value from a map (object) expression using the provided key. |
+| function(mapField, ...) |
+| [mapMerge(mapField, secondMap, otherMaps)](./firestore_lite_pipelines.md#mapmerge_70a564b) | (Public Preview) Creates an expression that merges multiple map values. |
+| [mapRemove(mapField, key)](./firestore_lite_pipelines.md#mapremove_bd5726e) | (Public Preview) Creates an expression that removes a key from the map at the specified field name. |
+| [mapRemove(mapField, keyExpr)](./firestore_lite_pipelines.md#mapremove_8406d13) | (Public Preview) Creates an expression that removes a key from the map at the specified field name. |
+| function(name, ...) |
+| [field(name)](./firestore_lite_pipelines.md#field_1eaaff4) | (Public Preview) Creates a [Field](./firestore_pipelines.field.md#field_class) instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). |
+| function(path, ...) |
+| [field(path)](./firestore_lite_pipelines.md#field_34ee07d) | (Public Preview) Creates a [Field](./firestore_pipelines.field.md#field_class) instance representing the field at the given path. |
+| function(pipeline, ...) |
+| [execute(pipeline)](./firestore_lite_pipelines.md#execute_01df620) | (Public Preview) Executes this pipeline and returns a Promise to represent the asynchronous operation.The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.The pipeline results are returned as a [PipelineSnapshot](./firestore_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) that contains a list of [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:
catch argument if there is an error, else return the result of the try argument evaluation.This overload is useful when a BooleanExpression is required.
-```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-ifError(constant(50).divide('length').gt(1), constant(false));
-
-```
- |
-| [ifError(tryExpr, catchExpr)](./firestore_lite_pipelines.md#iferror_756c12e) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// the entire title field if the array is empty or the field is another type.
-ifError(field("title").arrayGet(0), field("title"));
-
-```
- |
-| [ifError(tryExpr, catchValue)](./firestore_lite_pipelines.md#iferror_dc532f9) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// "Default Title"
-ifError(field("title").arrayGet(0), "Default Title");
-
-```
- |
+| [ifError(tryExpr, catchExpr)](./firestore_lite_pipelines.md#iferror_a99a327) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.This overload is useful when a BooleanExpression is required. |
+| [ifError(tryExpr, catchExpr)](./firestore_lite_pipelines.md#iferror_756c12e) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation. |
+| [ifError(tryExpr, catchValue)](./firestore_lite_pipelines.md#iferror_dc532f9) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation. |
| function(value, ...) |
| [constant(value)](./firestore_lite_pipelines.md#constant_0c00f91) | (Public Preview) Creates a Constant instance for a number value. |
| [constant(value)](./firestore_lite_pipelines.md#constant_6dac335) | (Public Preview) Creates a Constant instance for a VectorValue value. |
@@ -1639,78 +297,17 @@ ifError(field("title").arrayGet(0), "Default Title");
| [constant(value)](./firestore_lite_pipelines.md#constant_5131bf7) | (Public Preview) Creates a Constant instance for a Date value. |
| [constant(value)](./firestore_lite_pipelines.md#constant_fdf565d) | (Public Preview) Creates a Constant instance for a Bytes value. |
| [constant(value)](./firestore_lite_pipelines.md#constant_bcd2b0b) | (Public Preview) Creates a Constant instance for a DocumentReference value. |
-| [exists(value)](./firestore_lite_pipelines.md#exists_f3daf14) | (Public Preview) Creates an expression that checks if a field exists.
-```typescript
-// Check if the document has a field named "phoneNumber"
-exists(field("phoneNumber"));
-
-```
- |
-| [isAbsent(value)](./firestore_lite_pipelines.md#isabsent_f3daf14) | (Public Preview) Creates an expression that returns true if a value is absent. Otherwise, returns false even if the value is null.
-```typescript
-// Check if the field `value` is absent.
-isAbsent(field("value"));
-
-```
- |
-| [isError(value)](./firestore_lite_pipelines.md#iserror_f3daf14) | (Public Preview) Creates an expression that checks if a given expression produces an error.
-```typescript
-// Check if the result of a calculation is an error
-isError(field("title").arrayContains(1));
-
-```
- |
+| [exists(value)](./firestore_lite_pipelines.md#exists_f3daf14) | (Public Preview) Creates an expression that checks if a field exists. |
+| [isAbsent(value)](./firestore_lite_pipelines.md#isabsent_f3daf14) | (Public Preview) Creates an expression that returns true if a value is absent. Otherwise, returns false even if the value is null. |
+| [isError(value)](./firestore_lite_pipelines.md#iserror_f3daf14) | (Public Preview) Creates an expression that checks if a given expression produces an error. |
| function(vectorExpression, ...) |
-| [cosineDistance(vectorExpression, vector)](./firestore_lite_pipelines.md#cosinedistance_3a80317) | (Public Preview) Calculates the Cosine distance between a vector expression and a vector literal.
-```typescript
-// Calculate the cosine distance between the 'location' field and a target location
-cosineDistance(field("location"), [37.7749, -122.4194]);
-
-```
- |
-| [cosineDistance(vectorExpression, otherVectorExpression)](./firestore_lite_pipelines.md#cosinedistance_17b5bcc) | (Public Preview) Calculates the Cosine distance between two vector expressions.
-```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-cosineDistance(field("userVector"), field("itemVector"));
-
-```
- |
-| [dotProduct(vectorExpression, vector)](./firestore_lite_pipelines.md#dotproduct_3a80317) | (Public Preview) Calculates the dot product between a vector expression and a double array.
-```typescript
-// Calculate the dot product between a feature vector and a target vector
-dotProduct(field("features"), [0.5, 0.8, 0.2]);
-
-```
- |
-| [dotProduct(vectorExpression, otherVectorExpression)](./firestore_lite_pipelines.md#dotproduct_17b5bcc) | (Public Preview) Calculates the dot product between two vector expressions.
-```typescript
-// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2'
-dotProduct(field("docVector1"), field("docVector2"));
-
-```
- |
-| [euclideanDistance(vectorExpression, vector)](./firestore_lite_pipelines.md#euclideandistance_3a80317) | (Public Preview) Calculates the Euclidean distance between a vector expression and a double array.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-
-euclideanDistance(field("location"), [37.7749, -122.4194]);
-
-```
- |
-| [euclideanDistance(vectorExpression, otherVectorExpression)](./firestore_lite_pipelines.md#euclideandistance_17b5bcc) | (Public Preview) Calculates the Euclidean distance between two vector expressions.
-```typescript
-// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
-euclideanDistance(field("pointA"), field("pointB"));
-
-```
- |
-| [vectorLength(vectorExpression)](./firestore_lite_pipelines.md#vectorlength_58a039b) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector.
-```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength(field("embedding"));
-
-```
- |
+| [cosineDistance(vectorExpression, vector)](./firestore_lite_pipelines.md#cosinedistance_3a80317) | (Public Preview) Calculates the Cosine distance between a vector expression and a vector literal. |
+| [cosineDistance(vectorExpression, otherVectorExpression)](./firestore_lite_pipelines.md#cosinedistance_17b5bcc) | (Public Preview) Calculates the Cosine distance between two vector expressions. |
+| [dotProduct(vectorExpression, vector)](./firestore_lite_pipelines.md#dotproduct_3a80317) | (Public Preview) Calculates the dot product between a vector expression and a double array. |
+| [dotProduct(vectorExpression, otherVectorExpression)](./firestore_lite_pipelines.md#dotproduct_17b5bcc) | (Public Preview) Calculates the dot product between two vector expressions. |
+| [euclideanDistance(vectorExpression, vector)](./firestore_lite_pipelines.md#euclideandistance_3a80317) | (Public Preview) Calculates the Euclidean distance between a vector expression and a double array. |
+| [euclideanDistance(vectorExpression, otherVectorExpression)](./firestore_lite_pipelines.md#euclideandistance_17b5bcc) | (Public Preview) Calculates the Euclidean distance between two vector expressions. |
+| [vectorLength(vectorExpression)](./firestore_lite_pipelines.md#vectorlength_58a039b) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector. |
## Classes
@@ -1724,52 +321,22 @@ vectorLength(field("embedding"));
| [CollectionReference](./firestore_lite_pipelines.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). |
| [DocumentReference](./firestore_lite_pipelines.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. |
| [DocumentSnapshot](./firestore_lite_pipelines.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. |
-| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | (Public Preview) Represents an expression that can be evaluated to a value within the execution of a .Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:- \*\*Field references:\*\* Access values from document fields. - \*\*Literals:\*\* Represent constant values (strings, numbers, booleans). - \*\*Function calls:\*\* Apply functions to one or more expressions.The Expr class provides a fluent API for building expressions. You can chain together method calls to create complex expressions. |
-| [Field](./firestore_lite_pipelines.field.md#field_class) | (Public Preview) Represents a reference to a field in a Firestore document, or outputs of a stage.Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.
You can create a Field instance using the static method:
-```typescript
-// Create a Field instance for the 'name' field
-const nameField = field("name");
-
-// Create a Field instance for a nested field 'address.city'
-const cityField = field("address.city");
-
-```
- |
+| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | (Public Preview) Represents an expression that can be evaluated to a value within the execution of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:- \*\*Field references:\*\* Access values from document fields. - \*\*Literals:\*\* Represent constant values (strings, numbers, booleans). - \*\*Function calls:\*\* Apply functions to one or more expressions.The Expression class provides a fluent API for building expressions. You can chain together method calls to create complex expressions. |
+| [Field](./firestore_lite_pipelines.field.md#field_class) | (Public Preview) Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) stage.
Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.
You can create a Field instance using the static method: |
| [FieldPath](./firestore_lite_pipelines.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. |
| [FieldValue](./firestore_lite_pipelines.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). |
| [Firestore](./firestore_lite_pipelines.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). |
-| [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class) | (Public Preview) This class defines the base class for Firestore functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_.md#and_e72c712), , or the methods on (, , etc.) to construct new Function instances. |
+| [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class) | (Public Preview) This class defines the base class for Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_pipelines.md#and_e0c48bd), [equal()](./firestore_pipelines.md#equal_b3c3382), or the methods on [Expression](./firestore_pipelines.expression.md#expression_class) ([Expression.equal()](./firestore_pipelines.expression.md#expressionequal), [Expression.lessThan()](./firestore_pipelines.expression.md#expressionlessthan), etc.) to construct new Function instances. |
| [GeoPoint](./firestore_lite_pipelines.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. |
| [Ordering](./firestore_lite_pipelines.ordering.md#ordering_class) | (Public Preview) Represents an ordering criterion for sorting documents in a Firestore pipeline.You create Ordering instances using the ascending and descending helper functions. |
-| [Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class) | (Public Preview) The Pipeline class provides a flexible and expressive framework for building complex data transformation and query pipelines for Firestore.A pipeline takes data sources, such as Firestore collections or collection groups, and applies a series of stages that are chained together. Each stage takes the output from the previous stage (or the data source) and produces an output for the next stage (or as the final output of the pipeline).Expressions can be used within each stage to filter and transform data through the stage.NOTE: The chained stages do not prescribe exactly how Firestore will execute the pipeline. Instead, Firestore only guarantees that the result is the same as if the chained stages were executed in order.Usage Examples:
-```typescript
-const db: Firestore; // Assumes a valid firestore instance.
-
-// Example 1: Select specific fields and rename 'rating' to 'bookRating'
-const results1 = await execute(db.pipeline()
- .collection("books")
- .select("title", "author", field("rating").as("bookRating")));
-
-// Example 2: Filter documents where 'genre' is "Science Fiction" and 'published' is after 1950
-const results2 = await execute(db.pipeline()
- .collection("books")
- .where(and(field("genre").eq("Science Fiction"), field("published").gt(1950))));
-
-// Example 3: Calculate the average rating of books published after 1980
-const results3 = await execute(db.pipeline()
- .collection("books")
- .where(field("published").gt(1980))
- .aggregate(avg(field("rating")).as("averageRating")));
-
-```
- |
-| [PipelineResult](./firestore_lite_pipelines.pipelineresult.md#pipelineresult_class) | (Public Preview) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.
If the PipelineResult represents a non-document result, ref will return a undefined value. |
-| [PipelineSnapshot](./firestore_lite_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) | (Public Preview) Represents the results of a Firestore pipeline execution.A PipelineSnapshot contains zero or more objects representing the documents returned by a pipeline query. It provides methods to iterate over the documents and access metadata about the query results. |
-| [PipelineSource](./firestore_lite_pipelines.pipelinesource.md#pipelinesource_class) | (Public Preview) Provides the entry point for defining the data source of a Firestore .Use the methods of this class (e.g., , , , or ) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents. |
+| [Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class) | (Public Preview) The Pipeline class provides a flexible and expressive framework for building complex data transformation and query pipelines for Firestore.A pipeline takes data sources, such as Firestore collections or collection groups, and applies a series of stages that are chained together. Each stage takes the output from the previous stage (or the data source) and produces an output for the next stage (or as the final output of the pipeline).Expressions can be used within each stage to filter and transform data through the stage.NOTE: The chained stages do not prescribe exactly how Firestore will execute the pipeline. Instead, Firestore only guarantees that the result is the same as if the chained stages were executed in order.Usage Examples: |
+| [PipelineResult](./firestore_lite_pipelines.pipelineresult.md#pipelineresult_class) | (Public Preview) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the [PipelineResult.data()](./firestore_pipelines.pipelineresult.md#pipelineresultdata) or [PipelineResult.get()](./firestore_pipelines.pipelineresult.md#pipelineresultget) methods.
If the PipelineResult represents a non-document result, Example:
```typescript
const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
@@ -8086,30 +7630,35 @@ const results: PipelineResults = snapshot.results;
```
+## function(stringExpression, ...)
+
+### charLength(stringExpression) {:#charlength_c25a54a}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the character length of a string expression in UTF-8.
+
Signature:
```typescript
-export declare function execute(pipeline: Pipeline): Promise This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using expressions which are typically results of calling on instances. Example:
-```typescript
-// Calculate the average rating and the total number of books
-firestore.pipeline().collection("books")
- .aggregate(
- field("rating").avg().as("averageRating"),
- countAll().as("totalBooks")
- );
-
-```
- |
-| [aggregate(options)](./firestore_lite_pipelines.pipeline.md#pipelineaggregate) | | (Public Preview) Performs optionally grouped aggregation operations on the documents from previous stages. This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify: Example:
-```typescript
-// Calculate the average rating for each genre.
-firestore.pipeline().collection("books")
- .aggregate({
- accumulators: [avg(field("rating")).as("avg_rating")]
- groups: ["genre"]
- });
-
-```
- |
-| [distinct(group, additionalGroups)](./firestore_lite_pipelines.pipeline.md#pipelinedistinct) | | (Public Preview) Returns a set of distinct values from the inputs to this stage.This stage runs through the results from previous stages to include only results with unique combinations of values (, , etc).The parameters to this stage are defined using expressions or strings:- : Name of an existing field - : References an existing document field. - : Represents the result of a function with an assigned alias name using .Example:
-```typescript
-// Get a list of unique author names in uppercase and genre combinations.
-firestore.pipeline().collection("books")
- .distinct(toUppercase(field("author")).as("authorName"), field("genre"), "publishedAt")
- .select("authorName");
-
-```
- |
-| [distinct(options)](./firestore_lite_pipelines.pipeline.md#pipelinedistinct) | | (Public Preview) Returns a set of distinct values from the inputs to this stage.This stage runs through the results from previous stages to include only results with unique combinations of values (, , etc).The parameters to this stage are defined using expressions or strings:- : Name of an existing field - : References an existing document field. - : Represents the result of a function with an assigned alias name using .Example:
-```typescript
-// Get a list of unique author names in uppercase and genre combinations.
-firestore.pipeline().collection("books")
- .distinct(toUppercase(field("author")).as("authorName"), field("genre"), "publishedAt")
- .select("authorName");
-
-```
- |
+| [addFields(field, additionalFields)](./firestore_lite_pipelines.pipeline.md#pipelineaddfields) | | (Public Preview) Adds new fields to outputs from previous stages.This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).The added fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface)s, which can be:- [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [Expression](./firestore_pipelines.expression.md#expression_class): Either a literal value (see [constant()](./firestore_pipelines.md#constant_0c00f91)) or a computed value with an assigned alias using [Expression.as()](./firestore_pipelines.expression.md#expressionas).Example: |
+| [addFields(options)](./firestore_lite_pipelines.pipeline.md#pipelineaddfields) | | (Public Preview) Adds new fields to outputs from previous stages.This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).The added fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface)s, which can be:- [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [Expression](./firestore_pipelines.expression.md#expression_class): Either a literal value (see [constant()](./firestore_pipelines.md#constant_0c00f91)) or a computed value with an assigned alias using [Expression.as()](./firestore_pipelines.expression.md#expressionas).Example: |
+| [aggregate(accumulator, additionalAccumulators)](./firestore_lite_pipelines.pipeline.md#pipelineaggregate) | | (Public Preview) Performs aggregation operations on the documents from previous stages. This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class) expressions which are typically results of calling [Expression.as()](./firestore_pipelines.expression.md#expressionas) on [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) instances. Example: |
+| [aggregate(options)](./firestore_lite_pipelines.pipeline.md#pipelineaggregate) | | (Public Preview) Performs optionally grouped aggregation operations on the documents from previous stages. This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify: Example: |
+| [distinct(group, additionalGroups)](./firestore_lite_pipelines.pipeline.md#pipelinedistinct) | | (Public Preview) Returns a set of distinct values from the inputs to this stage.This stage runs through the results from previous stages to include only results with unique combinations of [Expression](./firestore_pipelines.expression.md#expression_class) values ([Field](./firestore_pipelines.field.md#field_class), [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class), etc).The parameters to this stage are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions or strings:- Example:
```typescript
// Find the 10 most similar books based on the book description.
@@ -131,278 +56,74 @@ firestore.pipeline().collection("books")
```
|
-| [limit(limit)](./firestore_lite_pipelines.pipeline.md#pipelinelimit) | | (Public Preview) Limits the maximum number of documents returned by previous stages to This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: Example:
-```typescript
-// Limit the results to the top 10 highest-rated books
-firestore.pipeline().collection('books')
- .sort(field('rating').descending())
- .limit(10);
-
-```
- |
-| [limit(options)](./firestore_lite_pipelines.pipeline.md#pipelinelimit) | | (Public Preview) Limits the maximum number of documents returned by previous stages to This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: Example:
-```typescript
-// Limit the results to the top 10 highest-rated books
-firestore.pipeline().collection('books')
- .sort(field('rating').descending())
- .limit(10);
+| [limit(limit)](./firestore_lite_pipelines.pipeline.md#pipelinelimit) | | (Public Preview) Limits the maximum number of documents returned by previous stages to This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: Example: |
+| [limit(options)](./firestore_lite_pipelines.pipeline.md#pipelinelimit) | | (Public Preview) Limits the maximum number of documents returned by previous stages to This stage is particularly useful when you want to retrieve a controlled subset of data from a potentially large result set. It's often used for: Example: |
+| [offset(offset)](./firestore_lite_pipelines.pipeline.md#pipelineoffset) | | (Public Preview) Skips the first This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. Example: |
+| [offset(options)](./firestore_lite_pipelines.pipeline.md#pipelineoffset) | | (Public Preview) Skips the first This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. Example: |
+| [rawStage(name, params, options)](./firestore_lite_pipelines.pipeline.md#pipelinerawstage) | | (Public Preview) Adds a raw stage to the pipeline. This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each raw stage is defined by a unique Example (Assuming there is no 'where' stage available in SDK): |
+| [removeFields(fieldValue, additionalFields)](./firestore_lite_pipelines.pipeline.md#pipelineremovefields) | | (Public Preview) Remove fields from outputs of previous stages.Example: |
+| [removeFields(options)](./firestore_lite_pipelines.pipeline.md#pipelineremovefields) | | (Public Preview) Remove fields from outputs of previous stages.Example: |
+| [replaceWith(fieldName)](./firestore_lite_pipelines.pipeline.md#pipelinereplacewith) | | (Public Preview) Fully overwrites all fields in a document with those coming from a nested map. This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value. Example: |
+| [replaceWith(expr)](./firestore_lite_pipelines.pipeline.md#pipelinereplacewith) | | (Public Preview) Fully overwrites all fields in a document with those coming from a map. This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value. Example: |
+| [replaceWith(options)](./firestore_lite_pipelines.pipeline.md#pipelinereplacewith) | | (Public Preview) Fully overwrites all fields in a document with those coming from a map. This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value. Example: |
+| [sample(documents)](./firestore_lite_pipelines.pipeline.md#pipelinesample) | | (Public Preview) Performs a pseudo-random sampling of the documents from the previous stage. This stage will filter documents pseudo-randomly. The parameter specifies how number of documents to be returned. Examples: |
+| [sample(options)](./firestore_lite_pipelines.pipeline.md#pipelinesample) | | (Public Preview) Performs a pseudo-random sampling of the documents from the previous stage. This stage will filter documents pseudo-randomly. The 'options' parameter specifies how sampling will be performed. See [SampleStageOptions](./firestore_pipelines.md#samplestageoptions) for more information. |
+| [select(selection, additionalSelections)](./firestore_lite_pipelines.pipeline.md#pipelineselect) | | (Public Preview) Selects or creates a set of fields from the outputs of previous stages. The selected fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions, which can be: If no selections are provided, the output of this stage is empty. Use [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields) instead if only additions are desired. Example: |
+| [select(options)](./firestore_lite_pipelines.pipeline.md#pipelineselect) | | (Public Preview) Selects or creates a set of fields from the outputs of previous stages. The selected fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions, which can be: If no selections are provided, the output of this stage is empty. Use [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields) instead if only additions are desired. Example: |
+| [sort(ordering, additionalOrderings)](./firestore_lite_pipelines.pipeline.md#pipelinesort) | | (Public Preview) Sorts the documents from previous stages based on one or more [Ordering](./firestore_pipelines.ordering.md#ordering_class) criteria. This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_pipelines.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. Example: |
+| [sort(options)](./firestore_lite_pipelines.pipeline.md#pipelinesort) | | (Public Preview) Sorts the documents from previous stages based on one or more [Ordering](./firestore_pipelines.ordering.md#ordering_class) criteria. This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_pipelines.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. Example: |
+| [union(other)](./firestore_lite_pipelines.pipeline.md#pipelineunion) | | (Public Preview) Performs union of all documents from two pipelines, including duplicates. This stage will pass through documents from previous stage, and also pass through documents from previous stage of the Example: |
+| [union(options)](./firestore_lite_pipelines.pipeline.md#pipelineunion) | | (Public Preview) Performs union of all documents from two pipelines, including duplicates. This stage will pass through documents from previous stage, and also pass through documents from previous stage of the Example: |
+| [unnest(selectable, indexField)](./firestore_lite_pipelines.pipeline.md#pipelineunnest) | | (Public Preview) Produces a document for each element in an input array.For each previous stage document, this stage will emit zero or more augmented documents. The input array specified by the This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class), typically including but not limited to: Example: |
+| [where(options)](./firestore_lite_pipelines.pipeline.md#pipelinewhere) | | (Public Preview) Filters the documents from previous stages to only include those matching the specified [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class). This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class), typically including but not limited to: Example: |
-```
- |
-| [offset(offset)](./firestore_lite_pipelines.pipeline.md#pipelineoffset) | | (Public Preview) Skips the first This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. Example:
-```typescript
-// Retrieve the second page of 20 results
-firestore.pipeline().collection('books')
- .sort(field('published').descending())
- .offset(20) // Skip the first 20 results
- .limit(20); // Take the next 20 results
-
-```
- |
-| [offset(options)](./firestore_lite_pipelines.pipeline.md#pipelineoffset) | | (Public Preview) Skips the first This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page. Example:
-```typescript
-// Retrieve the second page of 20 results
-firestore.pipeline().collection('books')
- .sort(field('published').descending())
- .offset(20) // Skip the first 20 results
- .limit(20); // Take the next 20 results
-
-```
- |
-| [rawStage(name, params, options)](./firestore_lite_pipelines.pipeline.md#pipelinerawstage) | | (Public Preview) Adds a raw stage to the pipeline. This method provides a flexible way to extend the pipeline's functionality by adding custom stages. Each raw stage is defined by a unique Example (Assuming there is no 'where' stage available in SDK):
-```typescript
-// Assume we don't have a built-in 'where' stage
-firestore.pipeline().collection('books')
- .rawStage('where', [field('published').lt(1900)]) // Custom 'where' stage
- .select('title', 'author');
-
-```
- |
-| [removeFields(fieldValue, additionalFields)](./firestore_lite_pipelines.pipeline.md#pipelineremovefields) | | (Public Preview) Remove fields from outputs of previous stages.Example:
-```typescript
-firestore.pipeline().collection('books')
- // removes field 'rating' and 'cost' from the previous stage outputs.
- .removeFields(
- field('rating'),
- 'cost'
- );
-
-```
- |
-| [removeFields(options)](./firestore_lite_pipelines.pipeline.md#pipelineremovefields) | | (Public Preview) Remove fields from outputs of previous stages.Example:
-```typescript
-firestore.pipeline().collection('books')
- // removes field 'rating' and 'cost' from the previous stage outputs.
- .removeFields(
- field('rating'),
- 'cost'
- );
-
-```
- |
-| [replaceWith(fieldName)](./firestore_lite_pipelines.pipeline.md#pipelinereplacewith) | | (Public Preview) Fully overwrites all fields in a document with those coming from a nested map. This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value. Example:
-```typescript
-// Input.
-// {
-// 'name': 'John Doe Jr.',
-// 'parents': {
-// 'father': 'John Doe Sr.',
-// 'mother': 'Jane Doe'
-// }
-// }
-
-// Emit parents as document.
-firestore.pipeline().collection('people').replaceWith('parents');
-
-// Output
-// {
-// 'father': 'John Doe Sr.',
-// 'mother': 'Jane Doe'
-// }
-
-```
- |
-| [replaceWith(expr)](./firestore_lite_pipelines.pipeline.md#pipelinereplacewith) | | (Public Preview) Fully overwrites all fields in a document with those coming from a map. This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value. Example:
-```typescript
-// Input.
-// {
-// 'name': 'John Doe Jr.',
-// 'parents': {
-// 'father': 'John Doe Sr.',
-// 'mother': 'Jane Doe'
-// }
-// }
-
-// Emit parents as document.
-firestore.pipeline().collection('people').replaceWith(map({
- foo: 'bar',
- info: {
- name: field('name')
- }
-}));
-
-// Output
-// {
-// 'father': 'John Doe Sr.',
-// 'mother': 'Jane Doe'
-// }
-
-```
- |
-| [replaceWith(options)](./firestore_lite_pipelines.pipeline.md#pipelinereplacewith) | | (Public Preview) Fully overwrites all fields in a document with those coming from a map. This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value. Example:
-```typescript
-// Input.
-// {
-// 'name': 'John Doe Jr.',
-// 'parents': {
-// 'father': 'John Doe Sr.',
-// 'mother': 'Jane Doe'
-// }
-// }
+## Pipeline.addFields()
-// Emit parents as document.
-firestore.pipeline().collection('people').replaceWith(map({
- foo: 'bar',
- info: {
- name: field('name')
- }
-}));
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-// Output
-// {
-// 'father': 'John Doe Sr.',
-// 'mother': 'Jane Doe'
-// }
+Adds new fields to outputs from previous stages.
-```
- |
-| [sample(documents)](./firestore_lite_pipelines.pipeline.md#pipelinesample) | | (Public Preview) Performs a pseudo-random sampling of the documents from the previous stage. This stage will filter documents pseudo-randomly. The parameter specifies how number of documents to be returned. Examples:
-```typescript
-// Sample 25 books, if available.
-firestore.pipeline().collection('books')
- .sample(25);
+This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).
-```
- |
-| [sample(options)](./firestore_lite_pipelines.pipeline.md#pipelinesample) | | (Public Preview) Performs a pseudo-random sampling of the documents from the previous stage. This stage will filter documents pseudo-randomly. The 'options' parameter specifies how sampling will be performed. See for more information. Examples:// Sample 10 books, if available. firestore.pipeline().collection("books") .sample({ documents: 10 });// Sample 50% of books. firestore.pipeline().collection("books") .sample({ percentage: 0.5 }); |
-| [select(selection, additionalSelections)](./firestore_lite_pipelines.pipeline.md#pipelineselect) | | (Public Preview) Selects or creates a set of fields from the outputs of previous stages. The selected fields are defined using expressions, which can be: If no selections are provided, the output of this stage is empty. Use instead if only additions are desired. Example:
-```typescript
-db.pipeline().collection("books")
- .select(
- "firstName",
- field("lastName"),
- field("address").toUppercase().as("upperAddress"),
- );
+The added fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface)s, which can be:
-```
- |
-| [select(options)](./firestore_lite_pipelines.pipeline.md#pipelineselect) | | (Public Preview) Selects or creates a set of fields from the outputs of previous stages. The selected fields are defined using expressions, which can be: If no selections are provided, the output of this stage is empty. Use instead if only additions are desired. Example:
-```typescript
-db.pipeline().collection("books")
- .select(
- "firstName",
- field("lastName"),
- field("address").toUppercase().as("upperAddress"),
- );
+- [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [Expression](./firestore_pipelines.expression.md#expression_class): Either a literal value (see [constant()](./firestore_pipelines.md#constant_0c00f91)) or a computed value with an assigned alias using [Expression.as()](./firestore_pipelines.expression.md#expressionas).
-```
- |
-| [sort(ordering, additionalOrderings)](./firestore_lite_pipelines.pipeline.md#pipelinesort) | | (Public Preview) Sorts the documents from previous stages based on one or more criteria. This stage allows you to order the results of your pipeline. You can specify multiple instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. Example:
-```typescript
-// Sort books by rating in descending order, and then by title in ascending order for books
-// with the same rating
-firestore.pipeline().collection("books")
- .sort(
- Ordering.of(field("rating")).descending(),
- Ordering.of(field("title")) // Ascending order is the default
- );
+Example:
-```
- |
-| [sort(options)](./firestore_lite_pipelines.pipeline.md#pipelinesort) | | (Public Preview) Sorts the documents from previous stages based on one or more criteria. This stage allows you to order the results of your pipeline. You can specify multiple instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified. Example:
-```typescript
-// Sort books by rating in descending order, and then by title in ascending order for books
-// with the same rating
-firestore.pipeline().collection("books")
- .sort(
- Ordering.of(field("rating")).descending(),
- Ordering.of(field("title")) // Ascending order is the default
- );
+Signature:
-```
- |
-| [union(other)](./firestore_lite_pipelines.pipeline.md#pipelineunion) | | (Public Preview) Performs union of all documents from two pipelines, including duplicates. This stage will pass through documents from previous stage, and also pass through documents from previous stage of the Example:
```typescript
-// Emit documents from books collection and magazines collection.
-firestore.pipeline().collection('books')
- .union(firestore.pipeline().collection('magazines'));
-
+addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline;
```
- |
-| [union(options)](./firestore_lite_pipelines.pipeline.md#pipelineunion) | | (Public Preview) Performs union of all documents from two pipelines, including duplicates. This stage will pass through documents from previous stage, and also pass through documents from previous stage of the Example:
-```typescript
-// Emit documents from books collection and magazines collection.
-firestore.pipeline().collection('books')
- .union(firestore.pipeline().collection('magazines'));
-```
- |
-| [unnest(selectable, indexField)](./firestore_lite_pipelines.pipeline.md#pipelineunnest) | | (Public Preview) Produces a document for each element in an input array.For each previous stage document, this stage will emit zero or more augmented documents. The input array specified by the This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of , typically including but not limited to: Example:
-```typescript
-firestore.pipeline().collection("books")
- .where(
- and(
- gt(field("rating"), 4.0), // Filter for ratings greater than 4.0
- field("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction")
- )
- );
-```
- |
-| [where(options)](./firestore_lite_pipelines.pipeline.md#pipelinewhere) | | (Public Preview) Filters the documents from previous stages to only include those matching the specified . This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of , typically including but not limited to: Example:
```typescript
firestore.pipeline().collection("books")
- .where(
- and(
- gt(field("rating"), 4.0), // Filter for ratings greater than 4.0
- field("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction")
- )
+ .addFields(
+ field("rating").as("bookRating"), // Rename 'rating' to 'bookRating'
+ add(5, field("quantity")).as("totalCost") // Calculate 'totalCost'
);
```
- |
## Pipeline.addFields()
@@ -413,52 +134,32 @@ Adds new fields to outputs from previous stages.
This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).
-The added fields are defined using s, which can be:
+The added fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface)s, which can be:
-- : References an existing document field. - : Either a literal value (see ) or a computed value (see ) with an assigned alias using .
+- [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [Expression](./firestore_pipelines.expression.md#expression_class): Either a literal value (see [constant()](./firestore_pipelines.md#constant_0c00f91)) or a computed value with an assigned alias using [Expression.as()](./firestore_pipelines.expression.md#expressionas).
Example:
-```typescript
-firestore.pipeline().collection("books")
- .addFields(
- field("rating").as("bookRating"), // Rename 'rating' to 'bookRating'
- add(5, field("quantity")).as("totalCost") // Calculate 'totalCost'
- );
-
-```
-
Signature:
```typescript
-addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline;
+addFields(options: AddFieldsStageOptions): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| field | [Selectable](./firestore_lite_pipelines.selectable.md#selectable_interface) | The first field to add to the documents, specified as a . |
-| additionalFields | [Selectable](./firestore_lite_pipelines.selectable.md#selectable_interface)\[\] | Optional additional fields to add to the documents, specified as s. A new Pipeline object with this stage appended to the stage list. |
+| options | [AddFieldsStageOptions](./firestore_lite_pipelines.md#addfieldsstageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.addFields()
+A new Pipeline object with this stage appended to the stage list.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Adds new fields to outputs from previous stages.
-
-This stage allows you to compute values on-the-fly based on existing data from previous stages or constants. You can use this to create new fields or overwrite existing ones (if there is name overlaps).
-
-The added fields are defined using s, which can be:
-
-- : References an existing document field. - : Either a literal value (see ) or a computed value (see ) with an assigned alias using .
-
-Example:
```typescript
firestore.pipeline().collection("books")
@@ -469,32 +170,38 @@ firestore.pipeline().collection("books")
```
+## Pipeline.aggregate()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Performs aggregation operations on the documents from previous stages.
+
+ This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using [AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class) expressions which are typically results of calling [Expression.as()](./firestore_pipelines.expression.md#expressionas) on [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) instances.
+
+ Example:
+
Signature:
```typescript
-addFields(options: AddFieldsStageOptions): Pipeline;
+aggregate(accumulator: AliasedAggregate, ...additionalAccumulators: AliasedAggregate[]): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [AddFieldsStageOptions](./firestore_lite_pipelines.md#addfieldsstageoptions) | An object that specifies required and optional parameters for the stage. A new Pipeline object with this stage appended to the stage list. |
+| accumulator | [AliasedAggregate](./firestore_lite_pipelines.aliasedaggregate.md#aliasedaggregate_class) | The first [AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class), wrapping an [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) and providing a name for the accumulated results. |
+| additionalAccumulators | [AliasedAggregate](./firestore_lite_pipelines.aliasedaggregate.md#aliasedaggregate_class)\[\] | Optional additional [AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class), each wrapping an [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) and providing a name for the accumulated results. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.aggregate()
+A new Pipeline object with this stage appended to the stage list.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Performs aggregation operations on the documents from previous stages.
-
- This stage allows you to calculate aggregate values over a set of documents. You define the aggregations to perform using expressions which are typically results of calling on instances.
-
- Example:
```typescript
// Calculate the average rating and the total number of books
@@ -506,23 +213,6 @@ firestore.pipeline().collection("books")
```
-Signature:
-
-```typescript
-aggregate(accumulator: AliasedAggregate, ...additionalAccumulators: AliasedAggregate[]): Pipeline;
-```
-
-#### Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| accumulator | [AliasedAggregate](./firestore_lite_pipelines.aliasedaggregate.md#aliasedaggregate_class) | The first , wrapping an and providing a name for the accumulated results. |
-| additionalAccumulators | [AliasedAggregate](./firestore_lite_pipelines.aliasedaggregate.md#aliasedaggregate_class)\[\] | Optional additional , each wrapping an and providing a name for the accumulated results. A new Pipeline object with this stage appended to the stage list. |
-
-Returns:
-
-[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-
## Pipeline.aggregate()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -532,20 +222,10 @@ Performs optionally grouped aggregation operations on the documents from previou
This stage allows you to calculate aggregate values over a set of documents, optionally grouped by one or more fields or functions. You can specify:
- Example:
-```typescript
-// Calculate the average rating for each genre.
-firestore.pipeline().collection("books")
- .aggregate({
- accumulators: [avg(field("rating")).as("avg_rating")]
- groups: ["genre"]
- });
-
-```
-
Signature:
```typescript
@@ -556,12 +236,27 @@ aggregate(options: AggregateStageOptions): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [AggregateStageOptions](./firestore_lite_pipelines.md#aggregatestageoptions) | An object that specifies required and optional parameters for the stage. A new object with this stage appended to the stage list. |
+| options | [AggregateStageOptions](./firestore_lite_pipelines.md#aggregatestageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Calculate the average rating for each genre.
+firestore.pipeline().collection("books")
+ .aggregate({
+ accumulators: [avg(field("rating")).as("avg_rating")]
+ groups: ["genre"]
+ });
+
+```
+
## Pipeline.distinct()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -569,21 +264,13 @@ aggregate(options: AggregateStageOptions): Pipeline;
Returns a set of distinct values from the inputs to this stage.
-This stage runs through the results from previous stages to include only results with unique combinations of values (, , etc).
+This stage runs through the results from previous stages to include only results with unique combinations of [Expression](./firestore_pipelines.expression.md#expression_class) values ([Field](./firestore_pipelines.field.md#field_class), [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class), etc).
-The parameters to this stage are defined using expressions or strings:
-
-- : Name of an existing field - : References an existing document field. - : Represents the result of a function with an assigned alias name using .
-
-Example:
+The parameters to this stage are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions or strings:
-```typescript
-// Get a list of unique author names in uppercase and genre combinations.
-firestore.pipeline().collection("books")
- .distinct(toUppercase(field("author")).as("authorName"), field("genre"), "publishedAt")
- .select("authorName");
+- `string`: Name of an existing field - [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class): Represents the result of a function with an assigned alias name using [Expression.as()](./firestore_pipelines.expression.md#expressionas).
-```
+Example:
Signature:
@@ -595,13 +282,26 @@ distinct(group: string | Selectable, ...additionalGroups: Array Example:
-```typescript
-// Retrieve the second page of 20 results
-firestore.pipeline().collection('books')
- .sort(field('published').descending())
- .offset(20) // Skip the first 20 results
- .limit(20); // Take the next 20 results
-
-```
-
Signature:
```typescript
@@ -786,22 +494,16 @@ offset(offset: number): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| offset | number | The number of documents to skip. A new Pipeline object with this stage appended to the stage list. |
+| offset | number | The number of documents to skip. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.offset()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Skips the first `offset` number of documents from the results of previous stages.
+A new Pipeline object with this stage appended to the stage list.
- This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page.
+### Example
- Example:
```typescript
// Retrieve the second page of 20 results
@@ -812,6 +514,17 @@ firestore.pipeline().collection('books')
```
+## Pipeline.offset()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Skips the first `offset` number of documents from the results of previous stages.
+
+ This stage is useful for implementing pagination in your pipelines, allowing you to retrieve results in chunks. It is typically used in conjunction with to control the size of each page.
+
+ Example:
+
Signature:
```typescript
@@ -822,12 +535,26 @@ offset(options: OffsetStageOptions): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [OffsetStageOptions](./firestore_lite_pipelines.md#offsetstageoptions) | An object that specifies required and optional parameters for the stage. A new Pipeline object with this stage appended to the stage list. |
+| options | [OffsetStageOptions](./firestore_lite_pipelines.md#offsetstageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new Pipeline object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Retrieve the second page of 20 results
+firestore.pipeline().collection('books')
+ .sort(field('published').descending())
+ .offset(20) // Skip the first 20 results
+ .limit(20); // Take the next 20 results
+
+```
+
## Pipeline.rawStage()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -839,14 +566,6 @@ Adds a raw stage to the pipeline.
Example (Assuming there is no 'where' stage available in SDK):
-```typescript
-// Assume we don't have a built-in 'where' stage
-firestore.pipeline().collection('books')
- .rawStage('where', [field('published').lt(1900)]) // Custom 'where' stage
- .select('title', 'author');
-
-```
-
Signature:
```typescript
@@ -861,12 +580,25 @@ rawStage(name: string, params: unknown[], options?: {
| --- | --- | --- |
| name | string | The unique name of the raw stage to add. |
| params | unknown\[\] | A list of parameters to configure the raw stage's behavior. |
-| options | { \[key: string\]: [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown; } | An object of key value pairs that specifies optional parameters for the stage. A new object with this stage appended to the stage list. |
+| options | { \[key: string\]: [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown; } | An object of key value pairs that specifies optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Assume we don't have a built-in 'where' stage
+firestore.pipeline().collection('books')
+ .rawStage('where', [field('published').lt(1900)]) // Custom 'where' stage
+ .select('title', 'author');
+
+```
+
## Pipeline.removeFields()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -876,16 +608,6 @@ Remove fields from outputs of previous stages.
Example:
-```typescript
-firestore.pipeline().collection('books')
- // removes field 'rating' and 'cost' from the previous stage outputs.
- .removeFields(
- field('rating'),
- 'cost'
- );
-
-```
-
Signature:
```typescript
@@ -897,20 +619,16 @@ removeFields(fieldValue: Field | string, ...additionalFields: Array Example:
+Signature:
+
+```typescript
+replaceWith(fieldName: string): Pipeline;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| fieldName | string | The [Field](./firestore_pipelines.field.md#field_class) field containing the nested map. |
+
+Returns:
+
+[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
```typescript
// Input.
// {
@@ -970,32 +733,37 @@ firestore.pipeline().collection('people').replaceWith('parents');
```
+## Pipeline.replaceWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Fully overwrites all fields in a document with those coming from a map.
+
+ This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value.
+
+ Example:
+
Signature:
```typescript
-replaceWith(fieldName: string): Pipeline;
+replaceWith(expr: Expression): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field containing the nested map. A new object with this stage appended to the stage list. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An [Expression](./firestore_pipelines.expression.md#expression_class) that when returned evaluates to a map. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.replaceWith()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Fully overwrites all fields in a document with those coming from a map.
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
- This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value.
+### Example
- Example:
```typescript
// Input.
@@ -1023,32 +791,37 @@ firestore.pipeline().collection('people').replaceWith(map({
```
+## Pipeline.replaceWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Fully overwrites all fields in a document with those coming from a map.
+
+ This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value.
+
+ Example:
+
Signature:
```typescript
-replaceWith(expr: Expression): Pipeline;
+replaceWith(options: ReplaceWithStageOptions): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An that when returned evaluates to a map. A new object with this stage appended to the stage list. |
+| options | [ReplaceWithStageOptions](./firestore_lite_pipelines.md#replacewithstageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.replaceWith()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Fully overwrites all fields in a document with those coming from a map.
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
- This stage allows you to emit a map value as a document. Each key of the map becomes a field on the document that contains the corresponding value.
+### Example
- Example:
```typescript
// Input.
@@ -1076,22 +849,6 @@ firestore.pipeline().collection('people').replaceWith(map({
```
-Signature:
-
-```typescript
-replaceWith(options: ReplaceWithStageOptions): Pipeline;
-```
-
-#### Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| options | [ReplaceWithStageOptions](./firestore_lite_pipelines.md#replacewithstageoptions) | An object that specifies required and optional parameters for the stage. A new object with this stage appended to the stage list. |
-
-Returns:
-
-[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-
## Pipeline.sample()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1099,16 +856,9 @@ replaceWith(options: ReplaceWithStageOptions): Pipeline;
Performs a pseudo-random sampling of the documents from the previous stage.
- This stage will filter documents pseudo-randomly. The parameter specifies how number of documents to be returned.
-
- Examples:
-
-```typescript
-// Sample 25 books, if available.
-firestore.pipeline().collection('books')
- .sample(25);
+ This stage will filter documents pseudo-randomly. The parameter specifies how number of documents to be returned.
-```
+ Examples:
Signature:
@@ -1120,12 +870,24 @@ sample(documents: number): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| documents | number | The number of documents to sample. A new object with this stage appended to the stage list. |
+| documents | number | The number of documents to sample. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Sample 25 books, if available.
+firestore.pipeline().collection('books')
+ .sample(25);
+
+```
+
## Pipeline.sample()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1133,13 +895,7 @@ sample(documents: number): Pipeline;
Performs a pseudo-random sampling of the documents from the previous stage.
- This stage will filter documents pseudo-randomly. The 'options' parameter specifies how sampling will be performed. See for more information.
-
- Examples:
-
-// Sample 10 books, if available. firestore.pipeline().collection("books") .sample({ documents: 10 });
-
-// Sample 50% of books. firestore.pipeline().collection("books") .sample({ percentage: 0.5 });
+ This stage will filter documents pseudo-randomly. The 'options' parameter specifies how sampling will be performed. See [SampleStageOptions](./firestore_pipelines.md#samplestageoptions) for more information.
Signature:
@@ -1151,12 +907,28 @@ sample(options: SampleStageOptions): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [SampleStageOptions](./firestore_lite_pipelines.md#samplestageoptions) | An object that specifies required and optional parameters for the stage. A new object with this stage appended to the stage list. |
+| options | [SampleStageOptions](./firestore_lite_pipelines.md#samplestageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Sample 10 books, if available.
+firestore.pipeline().collection("books")
+ .sample({ documents: 10 });
+
+// Sample 50% of books.
+firestore.pipeline().collection("books")
+ .sample({ percentage: 0.5 });
+
+```
+
## Pipeline.select()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1164,24 +936,14 @@ sample(options: SampleStageOptions): Pipeline;
Selects or creates a set of fields from the outputs of previous stages.
- The selected fields are defined using expressions, which can be:
+ The selected fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions, which can be:
- If no selections are provided, the output of this stage is empty. Use instead if only additions are desired.
+ If no selections are provided, the output of this stage is empty. Use [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields) instead if only additions are desired.
Example:
-```typescript
-db.pipeline().collection("books")
- .select(
- "firstName",
- field("lastName"),
- field("address").toUppercase().as("upperAddress"),
- );
-
-```
-
Signature:
```typescript
@@ -1192,27 +954,17 @@ select(selection: Selectable | string, ...additionalSelections: Array The selected fields are defined using expressions, which can be:
+A new Pipeline object with this stage appended to the stage list.
- If no selections are provided, the output of this stage is empty. Use instead if only additions are desired.
-
- Example:
```typescript
db.pipeline().collection("books")
@@ -1224,6 +976,21 @@ db.pipeline().collection("books")
```
+## Pipeline.select()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Selects or creates a set of fields from the outputs of previous stages.
+
+ The selected fields are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions, which can be:
+
+ If no selections are provided, the output of this stage is empty. Use [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields) instead if only additions are desired.
+
+ Example:
+
Signature:
```typescript
@@ -1234,34 +1001,38 @@ select(options: SelectStageOptions): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [SelectStageOptions](./firestore_lite_pipelines.md#selectstageoptions) | An object that specifies required and optional parameters for the stage. A new Pipeline object with this stage appended to the stage list. |
+| options | [SelectStageOptions](./firestore_lite_pipelines.md#selectstageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new Pipeline object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+db.pipeline().collection("books")
+ .select(
+ "firstName",
+ field("lastName"),
+ field("address").toUppercase().as("upperAddress"),
+ );
+
+```
+
## Pipeline.sort()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Sorts the documents from previous stages based on one or more criteria.
+Sorts the documents from previous stages based on one or more [Ordering](./firestore_pipelines.ordering.md#ordering_class) criteria.
- This stage allows you to order the results of your pipeline. You can specify multiple instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.
+ This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_pipelines.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.
Example:
-```typescript
-// Sort books by rating in descending order, and then by title in ascending order for books
-// with the same rating
-firestore.pipeline().collection("books")
- .sort(
- Ordering.of(field("rating")).descending(),
- Ordering.of(field("title")) // Ascending order is the default
- );
-
-```
-
Signature:
```typescript
@@ -1272,23 +1043,17 @@ sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| ordering | [Ordering](./firestore_lite_pipelines.ordering.md#ordering_class) | The first instance specifying the sorting criteria. |
-| additionalOrderings | [Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)\[\] | Optional additional instances specifying the additional sorting criteria. A new object with this stage appended to the stage list. |
+| ordering | [Ordering](./firestore_lite_pipelines.ordering.md#ordering_class) | The first [Ordering](./firestore_pipelines.ordering.md#ordering_class) instance specifying the sorting criteria. |
+| additionalOrderings | [Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)\[\] | Optional additional [Ordering](./firestore_pipelines.ordering.md#ordering_class) instances specifying the additional sorting criteria. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.sort()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
-Sorts the documents from previous stages based on one or more criteria.
+### Example
- This stage allows you to order the results of your pipeline. You can specify multiple instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.
-
- Example:
```typescript
// Sort books by rating in descending order, and then by title in ascending order for books
@@ -1301,6 +1066,17 @@ firestore.pipeline().collection("books")
```
+## Pipeline.sort()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Sorts the documents from previous stages based on one or more [Ordering](./firestore_pipelines.ordering.md#ordering_class) criteria.
+
+ This stage allows you to order the results of your pipeline. You can specify multiple [Ordering](./firestore_pipelines.ordering.md#ordering_class) instances to sort by multiple fields in ascending or descending order. If documents have the same value for a field used for sorting, the next specified ordering will be used. If all orderings result in equal comparison, the documents are considered equal and the order is unspecified.
+
+ Example:
+
Signature:
```typescript
@@ -1311,12 +1087,28 @@ sort(options: SortStageOptions): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [SortStageOptions](./firestore_lite_pipelines.md#sortstageoptions) | An object that specifies required and optional parameters for the stage. A new object with this stage appended to the stage list. |
+| options | [SortStageOptions](./firestore_lite_pipelines.md#sortstageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Sort books by rating in descending order, and then by title in ascending order for books
+// with the same rating
+firestore.pipeline().collection("books")
+ .sort(
+ Ordering.of(field("rating")).descending(),
+ Ordering.of(field("title")) // Ascending order is the default
+ );
+
+```
+
## Pipeline.union()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1324,17 +1116,10 @@ sort(options: SortStageOptions): Pipeline;
Performs union of all documents from two pipelines, including duplicates.
- This stage will pass through documents from previous stage, and also pass through documents from previous stage of the `other` given in parameter. The order of documents emitted from this stage is undefined.
+ This stage will pass through documents from previous stage, and also pass through documents from previous stage of the `other` [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) given in parameter. The order of documents emitted from this stage is undefined.
Example:
-```typescript
-// Emit documents from books collection and magazines collection.
-firestore.pipeline().collection('books')
- .union(firestore.pipeline().collection('magazines'));
-
-```
-
Signature:
```typescript
@@ -1345,22 +1130,16 @@ union(other: Pipeline): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| other | [Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class) | The other that is part of union. A new object with this stage appended to the stage list. |
+| other | [Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class) | The other [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) that is part of union. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.union()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Performs union of all documents from two pipelines, including duplicates.
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
- This stage will pass through documents from previous stage, and also pass through documents from previous stage of the `other` given in parameter. The order of documents emitted from this stage is undefined.
+### Example
- Example:
```typescript
// Emit documents from books collection and magazines collection.
@@ -1369,6 +1148,17 @@ firestore.pipeline().collection('books')
```
+## Pipeline.union()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Performs union of all documents from two pipelines, including duplicates.
+
+ This stage will pass through documents from previous stage, and also pass through documents from previous stage of the `other` [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) given in parameter. The order of documents emitted from this stage is undefined.
+
+ Example:
+
Signature:
```typescript
@@ -1379,12 +1169,24 @@ union(options: UnionStageOptions): Pipeline;
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [UnionStageOptions](./firestore_lite_pipelines.md#unionstageoptions) | An object that specifies required and optional parameters for the stage. A new object with this stage appended to the stage list. |
+| options | [UnionStageOptions](./firestore_lite_pipelines.md#unionstageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
+```typescript
+// Emit documents from books collection and magazines collection.
+firestore.pipeline().collection('books')
+ .union(firestore.pipeline().collection('magazines'));
+
+```
+
## Pipeline.unnest()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1400,6 +1202,28 @@ No documents are emitted when `selectable` evaluates to an empty array.
Example:
+Signature:
+
+```typescript
+unnest(selectable: Selectable, indexField?: string): Pipeline;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| selectable | [Selectable](./firestore_lite_pipelines.selectable.md#selectable_interface) | A selectable expression defining the field to unnest and the alias to use for each un-nested element in the output documents. |
+| indexField | string | An optional string value specifying the field path to write the offset (starting at zero) into the array the un-nested element is from |
+
+Returns:
+
+[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
+
+### Example
+
+
```typescript
// Input:
// { "title": "The Hitchhiker's Guide to the Galaxy", "tags": [ "comedy", "space", "adventure" ], ... }
@@ -1415,37 +1239,41 @@ firestore.pipeline().collection("books")
```
+## Pipeline.unnest()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Produces a document for each element in an input array.
+
+For each previous stage document, this stage will emit zero or more augmented documents. The input array specified by the `selectable` parameter, will emit an augmented document for each input array element. The input array element will augment the previous stage document by setting the `alias` field with the array element value.
+
+When `selectable` evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for the current input document, returning it as is with the `alias` field absent.
+
+No documents are emitted when `selectable` evaluates to an empty array.
+
+Example:
+
Signature:
```typescript
-unnest(selectable: Selectable, indexField?: string): Pipeline;
+unnest(options: UnnestStageOptions): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| selectable | [Selectable](./firestore_lite_pipelines.selectable.md#selectable_interface) | A selectable expression defining the field to unnest and the alias to use for each un-nested element in the output documents. |
-| indexField | string | An optional string value specifying the field path to write the offset (starting at zero) into the array the un-nested element is from A new object with this stage appended to the stage list. |
+| options | [UnnestStageOptions](./firestore_lite_pipelines.md#unneststageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.unnest()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Produces a document for each element in an input array.
-
-For each previous stage document, this stage will emit zero or more augmented documents. The input array specified by the `selectable` parameter, will emit an augmented document for each input array element. The input array element will augment the previous stage document by setting the `alias` field with the array element value.
-
-When `selectable` evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for the current input document, returning it as is with the `alias` field absent.
+A new [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) object with this stage appended to the stage list.
-No documents are emitted when `selectable` evaluates to an empty array.
+### Example
-Example:
```typescript
// Input:
@@ -1462,34 +1290,39 @@ firestore.pipeline().collection("books")
```
+## Pipeline.where()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Filters the documents from previous stages to only include those matching the specified [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class).
+
+ This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class), typically including but not limited to:
+
+ Example:
+
Signature:
```typescript
-unnest(options: UnnestStageOptions): Pipeline;
+where(condition: BooleanExpression): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| options | [UnnestStageOptions](./firestore_lite_pipelines.md#unneststageoptions) | An object that specifies required and optional parameters for the stage. A new object with this stage appended to the stage list. |
+| condition | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) to apply. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.where()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Filters the documents from previous stages to only include those matching the specified .
-
- This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of , typically including but not limited to:
+A new Pipeline object with this stage appended to the stage list.
- Example:
```typescript
firestore.pipeline().collection("books")
@@ -1502,34 +1335,39 @@ firestore.pipeline().collection("books")
```
+## Pipeline.where()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Filters the documents from previous stages to only include those matching the specified [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class).
+
+ This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class), typically including but not limited to:
+
+ Example:
+
Signature:
```typescript
-where(condition: BooleanExpression): Pipeline;
+where(options: WhereStageOptions): Pipeline;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| condition | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The to apply. A new Pipeline object with this stage appended to the stage list. |
+| options | [WhereStageOptions](./firestore_lite_pipelines.md#wherestageoptions) | An object that specifies required and optional parameters for the stage. |
Returns:
[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-## Pipeline.where()
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Filters the documents from previous stages to only include those matching the specified .
+A new Pipeline object with this stage appended to the stage list.
- This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL. You can filter documents based on their field values, using implementations of , typically including but not limited to:
+### Example
- Example:
```typescript
firestore.pipeline().collection("books")
@@ -1542,19 +1380,27 @@ firestore.pipeline().collection("books")
```
-Signature:
+### Example
+
```typescript
-where(options: WhereStageOptions): Pipeline;
-```
+const db: Firestore; // Assumes a valid firestore instance.
-#### Parameters
+// Example 1: Select specific fields and rename 'rating' to 'bookRating'
+const results1 = await execute(db.pipeline()
+ .collection("books")
+ .select("title", "author", field("rating").as("bookRating")));
-| Parameter | Type | Description |
-| --- | --- | --- |
-| options | [WhereStageOptions](./firestore_lite_pipelines.md#wherestageoptions) | An object that specifies required and optional parameters for the stage. A new Pipeline object with this stage appended to the stage list. |
+// Example 2: Filter documents where 'genre' is "Science Fiction" and 'published' is after 1950
+const results2 = await execute(db.pipeline()
+ .collection("books")
+ .where(and(field("genre").eq("Science Fiction"), field("published").gt(1950))));
-Returns:
+// Example 3: Calculate the average rating of books published after 1980
+const results3 = await execute(db.pipeline()
+ .collection("books")
+ .where(field("published").gt(1980))
+ .aggregate(avg(field("rating")).as("averageRating")));
-[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
+```
diff --git a/docs-devsite/firestore_lite_pipelines.pipelineresult.md b/docs-devsite/firestore_lite_pipelines.pipelineresult.md
index a2ac28a984..7dde1ef068 100644
--- a/docs-devsite/firestore_lite_pipelines.pipelineresult.md
+++ b/docs-devsite/firestore_lite_pipelines.pipelineresult.md
@@ -13,7 +13,7 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.
+A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the [PipelineResult.data()](./firestore_pipelines.pipelineresult.md#pipelineresultdata) or [PipelineResult.get()](./firestore_pipelines.pipelineresult.md#pipelineresultget) methods.
If the PipelineResult represents a non-document result, `ref` will return a undefined value.
@@ -27,10 +27,10 @@ export declare class PipelineResult Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines.
You can create a `Field` instance using the static method:
-```typescript
-// Create a Field instance for the 'name' field
-const nameField = field("name");
-
-// Create a Field instance for a nested field 'address.city'
-const cityField = field("address.city");
-
-```
-
Signature:
```typescript
@@ -101,3 +92,16 @@ get fieldName(): string;
```typescript
selectable: true;
```
+
+### Example
+
+
+```typescript
+// Create a Field instance for the 'name' field
+const nameField = field("name");
+
+// Create a Field instance for a nested field 'address.city'
+const cityField = field("address.city");
+
+```
+
diff --git a/docs-devsite/firestore_pipelines.functionexpression.md b/docs-devsite/firestore_pipelines.functionexpression.md
index 6ba0bb3367..2783f8168e 100644
--- a/docs-devsite/firestore_pipelines.functionexpression.md
+++ b/docs-devsite/firestore_pipelines.functionexpression.md
@@ -13,9 +13,9 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-This class defines the base class for Firestore functions, which can be evaluated within pipeline execution.
+This class defines the base class for Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.
-Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_.md#and_e72c712), , or the methods on (, , etc.) to construct new Function instances.
+Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_pipelines.md#and_e0c48bd), [equal()](./firestore_pipelines.md#equal_b3c3382), or the methods on [Expression](./firestore_pipelines.expression.md#expression_class) ([Expression.equal()](./firestore_pipelines.expression.md#expressionequal), [Expression.lessThan()](./firestore_pipelines.expression.md#expressionlessthan), etc.) to construct new Function instances.
Signature:
diff --git a/docs-devsite/firestore_pipelines.md b/docs-devsite/firestore_pipelines.md
index 2a3ba65e1f..83f2763dd9 100644
--- a/docs-devsite/firestore_pipelines.md
+++ b/docs-devsite/firestore_pipelines.md
@@ -16,1630 +16,279 @@ https://github.com/firebase/firebase-js-sdk
| Function | Description |
| --- | --- |
| function() |
-| [countAll()](./firestore_pipelines.md#countall) | (Public Preview) Creates an aggregation that counts the total number of stage inputs.
-```typescript
-// Count the total number of input documents
-countAll().as("totalDocument");
-
-```
- A new representing the 'countAll' aggregation. |
-| [currentTimestamp()](./firestore_pipelines.md#currenttimestamp) | (Public Preview) Creates an expression that evaluates to the current server timestamp.
-```typescript
-// Get the current server timestamp
-currentTimestamp()
-
-```
- A new Expression representing the current server timestamp. |
+| [countAll()](./firestore_pipelines.md#countall) | (Public Preview) Creates an aggregation that counts the total number of stage inputs. |
+| [currentTimestamp()](./firestore_pipelines.md#currenttimestamp) | (Public Preview) Creates an expression that evaluates to the current server timestamp. |
| function(array, ...) |
-| [arrayContains(array, element)](./firestore_pipelines.md#arraycontains_a00ea48) | (Public Preview) Creates an expression that checks if an array expression contains a specific element.
-```typescript
-// Check if the 'colors' array contains the value of field 'selectedColor'
-arrayContains(field("colors"), field("selectedColor"));
-
-```
- |
-| [arrayContains(array, element)](./firestore_pipelines.md#arraycontains_7328608) | (Public Preview) Creates an expression that checks if an array expression contains a specific element.
-```typescript
-// Check if the 'colors' array contains "red"
-arrayContains(field("colors"), "red");
-
-```
- |
-| [arrayContainsAll(array, values)](./firestore_pipelines.md#arraycontainsall_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements.
-```typescript
-// Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1"
-arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]);
-
-```
- |
-| [arrayContainsAll(array, arrayExpression)](./firestore_pipelines.md#arraycontainsall_7b535db) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements.
-```typescript
-// Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1"
-arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]);
-
-```
- |
-| [arrayContainsAny(array, values)](./firestore_pipelines.md#arraycontainsany_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements.
-```typescript
-// Check if the 'categories' array contains either values from field "cate1" or "Science"
-arrayContainsAny(field("categories"), [field("cate1"), "Science"]);
-
-```
- |
-| [arrayContainsAny(array, values)](./firestore_pipelines.md#arraycontainsany_c381a96) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements.
-```typescript
-// Check if the 'categories' array contains either values from field "cate1" or "Science"
-arrayContainsAny(field("categories"), array([field("cate1"), "Science"]));
-
-```
- |
-| [arrayLength(array)](./firestore_pipelines.md#arraylength_195e339) | (Public Preview) Creates an expression that calculates the length of an array expression.
-```typescript
-// Get the number of items in the 'cart' array
-arrayLength(field("cart"));
-
-```
- |
+| [arrayContains(array, element)](./firestore_pipelines.md#arraycontains_a00ea48) | (Public Preview) Creates an expression that checks if an array expression contains a specific element. |
+| [arrayContains(array, element)](./firestore_pipelines.md#arraycontains_7328608) | (Public Preview) Creates an expression that checks if an array expression contains a specific element. |
+| [arrayContainsAll(array, values)](./firestore_pipelines.md#arraycontainsall_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements. |
+| [arrayContainsAll(array, arrayExpression)](./firestore_pipelines.md#arraycontainsall_7b535db) | (Public Preview) Creates an expression that checks if an array expression contains all the specified elements. |
+| [arrayContainsAny(array, values)](./firestore_pipelines.md#arraycontainsany_c658ad5) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements. |
+| [arrayContainsAny(array, values)](./firestore_pipelines.md#arraycontainsany_c381a96) | (Public Preview) Creates an expression that checks if an array expression contains any of the specified elements. |
+| [arrayLength(array)](./firestore_pipelines.md#arraylength_195e339) | (Public Preview) Creates an expression that calculates the length of an array expression. |
| function(arrayExpression, ...) |
-| [arrayGet(arrayExpression, offset)](./firestore_pipelines.md#arrayget_f2e27cc) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index 1.
-arrayGet(field('tags'), 1);
-
-```
- |
-| [arrayGet(arrayExpression, offsetExpr)](./firestore_pipelines.md#arrayget_484550d) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet(field('tags'), field('favoriteTag'));
-
-```
- |
-| [join(arrayExpression, delimiterExpression)](./firestore_pipelines.md#join_313e6aa) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join an array of string using the delimiter from the 'separator' field.
-join(array(['foo', 'bar']), field("separator"))
-
-```
- |
-| [join(arrayExpression, delimiter)](./firestore_pipelines.md#join_d088d29) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join(field("tags"), ", ")
-
-```
- |
+| [arrayGet(arrayExpression, offset)](./firestore_pipelines.md#arrayget_f2e27cc) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayGet(arrayExpression, offsetExpr)](./firestore_pipelines.md#arrayget_484550d) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [join(arrayExpression, delimiterExpression)](./firestore_pipelines.md#join_313e6aa) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
+| [join(arrayExpression, delimiter)](./firestore_pipelines.md#join_d088d29) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
| function(arrayField, ...) |
-| [arrayGet(arrayField, offset)](./firestore_pipelines.md#arrayget_3f58471) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index 1.
-arrayGet('tags', 1);
-
-```
- |
-| [arrayGet(arrayField, offsetExpr)](./firestore_pipelines.md#arrayget_1904c9a) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet('tags', field('favoriteTag'));
-
-```
- |
+| [arrayGet(arrayField, offset)](./firestore_pipelines.md#arrayget_3f58471) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayGet(arrayField, offsetExpr)](./firestore_pipelines.md#arrayget_1904c9a) | (Public Preview) Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
| function(arrayFieldName, ...) |
-| [join(arrayFieldName, delimiter)](./firestore_pipelines.md#join_478ef36) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join("tags", ", ")
-
-```
- |
-| [join(arrayFieldName, delimiterExpression)](./firestore_pipelines.md#join_829294c) | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-join('tags', field("separator"))
-
-```
- |
+| [join(arrayFieldName, delimiter)](./firestore_pipelines.md#join_478ef36) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
+| [join(arrayFieldName, delimiterExpression)](./firestore_pipelines.md#join_829294c) | (Public Preview) Creates an expression that joins the elements of an array into a string. |
| function(base, ...) |
-| [pow(base, exponent)](./firestore_pipelines.md#pow_e4a9e64) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow(field("base"), field("exponent"));
-
-```
- |
-| [pow(base, exponent)](./firestore_pipelines.md#pow_93eae7f) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent.
-```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow(field("base"), 2);
-
-```
- |
-| [pow(base, exponent)](./firestore_pipelines.md#pow_a237721) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow("base", field("exponent"));
-
-```
- |
-| [pow(base, exponent)](./firestore_pipelines.md#pow_f4d7908) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent.
-```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow("base", 2);
-
-```
- |
+| [pow(base, exponent)](./firestore_pipelines.md#pow_e4a9e64) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent expression. |
+| [pow(base, exponent)](./firestore_pipelines.md#pow_93eae7f) | (Public Preview) Creates an expression that returns the value of the base expression raised to the power of the exponent. |
+| [pow(base, exponent)](./firestore_pipelines.md#pow_a237721) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent expression. |
+| [pow(base, exponent)](./firestore_pipelines.md#pow_f4d7908) | (Public Preview) Creates an expression that returns the value of the base field raised to the power of the exponent. |
| function(booleanExpr, ...) |
-| [countIf(booleanExpr)](./firestore_pipelines.md#countif_c5b8fb1) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the provided boolean expression evaluates to true.
-```typescript
-// Count the number of documents where 'is_active' field equals true
-countIf(field("is_active").equal(true)).as("numActiveDocuments");
-
-```
- |
-| [not(booleanExpr)](./firestore_pipelines.md#not_c5b8fb1) | (Public Preview) Creates an expression that negates a filter condition.
-```typescript
-// Find documents where the 'completed' field is NOT true
-not(equal("completed", true));
-
-```
- |
+| [countIf(booleanExpr)](./firestore_pipelines.md#countif_c5b8fb1) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the provided boolean expression evaluates to true. |
+| [not(booleanExpr)](./firestore_pipelines.md#not_c5b8fb1) | (Public Preview) Creates an expression that negates a filter condition. |
| function(condition, ...) |
-| [conditional(condition, thenExpr, elseExpr)](./firestore_pipelines.md#conditional_07a206d) | (Public Preview) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-conditional(
- greaterThan("age", 18), constant("Adult"), constant("Minor"));
-
-```
- |
+| [conditional(condition, thenExpr, elseExpr)](./firestore_pipelines.md#conditional_07a206d) | (Public Preview) Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false. |
| function(documentPath, ...) |
-| [documentId(documentPath)](./firestore_pipelines.md#documentid_cef293c) | (Public Preview) Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(myDocumentReference);
-
-```
- A new representing the documentId operation. |
+| [documentId(documentPath)](./firestore_pipelines.md#documentid_cef293c) | (Public Preview) Creates an expression that returns the document ID from a path. |
| function(documentPathExpr, ...) |
-| [documentId(documentPathExpr)](./firestore_pipelines.md#documentid_9a69021) | (Public Preview) Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(field("__path__"));
-
-```
- A new representing the documentId operation. |
+| [documentId(documentPathExpr)](./firestore_pipelines.md#documentid_9a69021) | (Public Preview) Creates an expression that returns the document ID from a path. |
| function(element, ...) |
-| [notEqualAny(element, values)](./firestore_pipelines.md#notequalany_c2c5bcb) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny(field("status"), ["pending", field("rejectedStatus")]);
-
-```
- |
-| [notEqualAny(element, arrayExpression)](./firestore_pipelines.md#notequalany_16b2851) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of the field 'rejectedStatus'
-notEqualAny(field("status"), ["pending", field("rejectedStatus")]);
-
-```
- |
+| [notEqualAny(element, values)](./firestore_pipelines.md#notequalany_c2c5bcb) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. |
+| [notEqualAny(element, arrayExpression)](./firestore_pipelines.md#notequalany_16b2851) | (Public Preview) Creates an expression that checks if an expression is not equal to any of the provided values or expressions. |
| function(elements, ...) |
-| [array(elements)](./firestore_pipelines.md#array_7d853aa) | (Public Preview) Creates an expression that creates a Firestore array value from an input array.
-```typescript
-// Create an array value from the input array and reference the 'baz' field value from the input document.
-array(['bar', Field.of('baz')]).as('foo');
-
-```
- |
-| [map(elements)](./firestore_pipelines.md#map_ce5dee1) | (Public Preview) Creates an expression that creates a Firestore map value from an input object.
-```typescript
-// Create a map from the input object and reference the 'baz' field value from the input document.
-map({foo: 'bar', baz: Field.of('baz')}).as('data');
-
-```
- |
+| [array(elements)](./firestore_pipelines.md#array_7d853aa) | (Public Preview) Creates an expression that creates a Firestore array value from an input array. |
+| [map(elements)](./firestore_pipelines.md#map_ce5dee1) | (Public Preview) Creates an expression that creates a Firestore map value from an input object. |
| function(expr, ...) |
| [abs(expr)](./firestore_pipelines.md#abs_005f3d4) | (Public Preview) Creates an expression that computes the absolute value of a numeric value. |
-| [ascending(expr)](./firestore_pipelines.md#ascending_005f3d4) | (Public Preview) Creates an that sorts documents in ascending order based on an expression.
-```typescript
-// Sort documents by the 'name' field in lowercase in ascending order
-firestore.pipeline().collection("users")
- .sort(ascending(field("name").toLower()));
-
-```
- |
-| [byteLength(expr)](./firestore_pipelines.md#bytelength_005f3d4) | (Public Preview) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob.
-```typescript
-// Calculate the length of the 'myString' field in bytes.
-byteLength(field("myString"));
-
-```
- |
+| [ascending(expr)](./firestore_pipelines.md#ascending_005f3d4) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on an expression. |
+| [byteLength(expr)](./firestore_pipelines.md#bytelength_005f3d4) | (Public Preview) Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob. |
| [countDistinct(expr)](./firestore_pipelines.md#countdistinct_3c28b08) | (Public Preview) Creates an aggregation that counts the number of distinct values of a field. |
-| [descending(expr)](./firestore_pipelines.md#descending_005f3d4) | (Public Preview) Creates an that sorts documents in descending order based on an expression.
-```typescript
-// Sort documents by the 'name' field in lowercase in descending order
-firestore.pipeline().collection("users")
- .sort(descending(field("name").toLower()));
-
-```
- |
+| [descending(expr)](./firestore_pipelines.md#descending_005f3d4) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on an expression. |
| [floor(expr)](./firestore_pipelines.md#floor_005f3d4) | (Public Preview) Creates an expression that computes the floor of a numeric value. |
-| [timestampToUnixMicros(expr)](./firestore_pipelines.md#timestamptounixmicros_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros(field("timestamp"));
-
-```
- |
-| [timestampToUnixMillis(expr)](./firestore_pipelines.md#timestamptounixmillis_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis(field("timestamp"));
-
-```
- |
-| [timestampToUnixSeconds(expr)](./firestore_pipelines.md#timestamptounixseconds_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds(field("timestamp"));
-
-```
- |
-| [unixMicrosToTimestamp(expr)](./firestore_pipelines.md#unixmicrostotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp(field("microseconds"));
-
-```
- |
-| [unixMillisToTimestamp(expr)](./firestore_pipelines.md#unixmillistotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp(field("milliseconds"));
-
-```
- |
-| [unixSecondsToTimestamp(expr)](./firestore_pipelines.md#unixsecondstotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp(field("seconds"));
-
-```
- |
+| [timestampToUnixMicros(expr)](./firestore_pipelines.md#timestamptounixmicros_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixMillis(expr)](./firestore_pipelines.md#timestamptounixmillis_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixSeconds(expr)](./firestore_pipelines.md#timestamptounixseconds_005f3d4) | (Public Preview) Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [unixMicrosToTimestamp(expr)](./firestore_pipelines.md#unixmicrostotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixMillisToTimestamp(expr)](./firestore_pipelines.md#unixmillistotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixSecondsToTimestamp(expr)](./firestore_pipelines.md#unixsecondstotimestamp_005f3d4) | (Public Preview) Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
| function(expression, ...) |
-| [arraySum(expression)](./firestore_pipelines.md#arraysum_1138a27) | (Public Preview) Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-arraySum(field("scores"));
-
-```
- |
-| [average(expression)](./firestore_pipelines.md#average_1138a27) | (Public Preview) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs.
-```typescript
-// Calculate the average age of users
-average(field("age")).as("averageAge");
-
-```
- |
-| [ceil(expression)](./firestore_pipelines.md#ceil_1138a27) | (Public Preview) Creates an expression that computes the ceiling of a numeric value.
-```typescript
-// Compute the ceiling of the 'price' field.
-ceil(field("price"));
-
-```
- |
-| [collectionId(expression)](./firestore_pipelines.md#collectionid_1138a27) | (Public Preview) Creates an expression that returns the collection ID from a path.
-```typescript
-// Get the collection ID from a path.
-collectionId(field("__name__"));
-
-```
- |
-| [count(expression)](./firestore_pipelines.md#count_1138a27) | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression.
-```typescript
-// Count the number of items where the price is greater than 10
-count(field("price").greaterThan(10)).as("expensiveItemCount");
-
-```
- |
-| [divide(expression, value)](./firestore_pipelines.md#divide_01df3cf) | (Public Preview) Creates an expression that divides an expression by a constant value.
-```typescript
-// Divide the 'value' field by 10
-divide(field("value"), 10);
-
-```
- |
-| [equal(expression, value)](./firestore_pipelines.md#equal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is equal to a constant value.
-```typescript
-// Check if the 'age' field is equal to 21
-equal(field("age"), 21);
-
-```
- |
-| [equalAny(expression, values)](./firestore_pipelines.md#equalany_7e759b5) | (Public Preview) Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny(field("category"), [constant("Electronics"), field("primaryType")]);
-
-```
- |
-| [equalAny(expression, arrayExpression)](./firestore_pipelines.md#equalany_214ce68) | (Public Preview) Creates an expression that checks if an expression is equal to any of the provided values.
-```typescript
-// Check if the 'category' field is set to a value in the disabledCategories field
-equalAny(field("category"), field('disabledCategories'));
-
-```
- |
-| [exp(expression)](./firestore_pipelines.md#exp_1138a27) | (Public Preview) Creates an expression that computes e to the power of the expression's result.
-```typescript
-// Compute e to the power of 2.
-exp(constant(2));
-
-```
- A new representing the exp of the numeric value. |
-| [greaterThan(expression, value)](./firestore_pipelines.md#greaterthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than a constant value.
-```typescript
-// Check if the 'age' field is greater than 18
-greaterThan(field("age"), 18);
-
-```
- |
-| [greaterThanOrEqual(expression, value)](./firestore_pipelines.md#greaterthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than or equal to a constant value.
-```typescript
-// Check if the 'quantity' field is greater than or equal to 10
-greaterThanOrEqual(field("quantity"), 10);
-
-```
- |
-| [length\_2(expression)](./firestore_pipelines.md#length_2_1138a27) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes.
-```typescript
-// Get the length of the 'name' field.
-length(field("name"));
-
-// Get the number of items in the 'cart' array.
-length(field("cart"));
-
-```
- |
-| [lessThan(expression, value)](./firestore_pipelines.md#lessthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than a constant value.
-```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), 30);
-
-```
- |
-| [lessThanOrEqual(expression, value)](./firestore_pipelines.md#lessthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than or equal to a constant value.
-```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), 20);
-
-```
- |
-| [ln(expression)](./firestore_pipelines.md#ln_1138a27) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value.
-```typescript
-// Compute the natural logarithm of the 'value' field.
-ln(field("value"));
-
-```
- |
-| [log(expression, base)](./firestore_pipelines.md#log_ac183e2) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with base 10.
-log(field("value"), 10);
-
-```
- |
-| [log(expression, base)](./firestore_pipelines.md#log_1894737) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with the base in the 'base' field.
-log(field("value"), field("base"));
-
-```
- |
-| [log10(expression)](./firestore_pipelines.md#log10_1138a27) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value.
-```typescript
-// Compute the base-10 logarithm of the 'value' field.
-log10(field("value"));
-
-```
- |
-| [maximum(expression)](./firestore_pipelines.md#maximum_1138a27) | (Public Preview) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-maximum(field("score")).as("highestScore");
-
-```
- |
-| [minimum(expression)](./firestore_pipelines.md#minimum_1138a27) | (Public Preview) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs.
-```typescript
-// Find the lowest price of all products
-minimum(field("price")).as("lowestPrice");
-
-```
- |
-| [mod(expression, value)](./firestore_pipelines.md#mod_01df3cf) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant.
-```typescript
-// Calculate the remainder of dividing 'field1' by 5.
-mod(field("field1"), 5);
-
-```
- |
-| [notEqual(expression, value)](./firestore_pipelines.md#notequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is not equal to a constant value.
-```typescript
-// Check if the 'status' field is not equal to "completed"
-notEqual(field("status"), "completed");
-
-```
- |
-| [round(expression)](./firestore_pipelines.md#round_1138a27) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number.
-```typescript
-// Round the value of the 'price' field.
-round(field("price"));
-
-```
- |
-| [round(expression, decimalPlaces)](./firestore_pipelines.md#round_a3a92d0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-round(field("price"), constant(2));
-
-```
- |
+| [arraySum(expression)](./firestore_pipelines.md#arraysum_1138a27) | (Public Preview) Creates an expression that computes the sum of the elements in an array. |
+| [average(expression)](./firestore_pipelines.md#average_1138a27) | (Public Preview) Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs. |
+| [ceil(expression)](./firestore_pipelines.md#ceil_1138a27) | (Public Preview) Creates an expression that computes the ceiling of a numeric value. |
+| [collectionId(expression)](./firestore_pipelines.md#collectionid_1138a27) | (Public Preview) Creates an expression that returns the collection ID from a path. |
+| [count(expression)](./firestore_pipelines.md#count_1138a27) | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression. |
+| [divide(expression, value)](./firestore_pipelines.md#divide_01df3cf) | (Public Preview) Creates an expression that divides an expression by a constant value. |
+| [equal(expression, value)](./firestore_pipelines.md#equal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is equal to a constant value. |
+| [equalAny(expression, values)](./firestore_pipelines.md#equalany_7e759b5) | (Public Preview) Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions. |
+| [equalAny(expression, arrayExpression)](./firestore_pipelines.md#equalany_214ce68) | (Public Preview) Creates an expression that checks if an expression is equal to any of the provided values. |
+| [exp(expression)](./firestore_pipelines.md#exp_1138a27) | (Public Preview) Creates an expression that computes e to the power of the expression's result. |
+| [greaterThan(expression, value)](./firestore_pipelines.md#greaterthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than a constant value. |
+| [greaterThanOrEqual(expression, value)](./firestore_pipelines.md#greaterthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is greater than or equal to a constant value. |
+| [length\_2(expression)](./firestore_pipelines.md#length_2_1138a27) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
+| [lessThan(expression, value)](./firestore_pipelines.md#lessthan_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than a constant value. |
+| [lessThanOrEqual(expression, value)](./firestore_pipelines.md#lessthanorequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is less than or equal to a constant value. |
+| [ln(expression)](./firestore_pipelines.md#ln_1138a27) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value. |
+| [log(expression, base)](./firestore_pipelines.md#log_ac183e2) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base. |
+| [log(expression, base)](./firestore_pipelines.md#log_1894737) | (Public Preview) Creates an expression that computes the logarithm of an expression to a given base. |
+| [log10(expression)](./firestore_pipelines.md#log10_1138a27) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value. |
+| [maximum(expression)](./firestore_pipelines.md#maximum_1138a27) | (Public Preview) Creates an aggregation that finds the maximum value of an expression across multiple stage inputs. |
+| [minimum(expression)](./firestore_pipelines.md#minimum_1138a27) | (Public Preview) Creates an aggregation that finds the minimum value of an expression across multiple stage inputs. |
+| [mod(expression, value)](./firestore_pipelines.md#mod_01df3cf) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant. |
+| [notEqual(expression, value)](./firestore_pipelines.md#notequal_01df3cf) | (Public Preview) Creates an expression that checks if an expression is not equal to a constant value. |
+| [round(expression)](./firestore_pipelines.md#round_1138a27) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number. |
+| [round(expression, decimalPlaces)](./firestore_pipelines.md#round_a3a92d0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
| [split(expression, delimiter)](./firestore_pipelines.md#split_5b5612b) | (Public Preview) Creates an expression that splits a string into an array of substrings based on the provided delimiter. |
| [split(expression, delimiter)](./firestore_pipelines.md#split_5a171ed) | (Public Preview) Creates an expression that splits a string into an array of substrings based on the provided delimiter. |
-| [sqrt(expression)](./firestore_pipelines.md#sqrt_1138a27) | (Public Preview) Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt(field("value"));
-
-```
- |
-| [subtract(expression, value)](./firestore_pipelines.md#subtract_01df3cf) | (Public Preview) Creates an expression that subtracts a constant value from an expression.
-```typescript
-// Subtract the constant value 2 from the 'value' field
-subtract(field("value"), 2);
-
-```
- |
-| [sum(expression)](./firestore_pipelines.md#sum_1138a27) | (Public Preview) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-sum(field("orderAmount")).as("totalRevenue");
-
-```
- |
+| [sqrt(expression)](./firestore_pipelines.md#sqrt_1138a27) | (Public Preview) Creates an expression that computes the square root of a numeric value. |
+| [subtract(expression, value)](./firestore_pipelines.md#subtract_01df3cf) | (Public Preview) Creates an expression that subtracts a constant value from an expression. |
+| [sum(expression)](./firestore_pipelines.md#sum_1138a27) | (Public Preview) Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs. |
| [type(expression)](./firestore_pipelines.md#type_1138a27) | (Public Preview) Creates an expression that returns the data type of an expression's result. |
| function(field, ...) |
-| [isAbsent(field)](./firestore_pipelines.md#isabsent_0fb8cd4) | (Public Preview) Creates an expression that returns Example:
-```typescript
-const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
- .where(gt(field("rating"), 4.5))
- .select("title", "author", "rating"));
-
-const results: PipelineResults = snapshot.results;
-
-```
- |
-| function(path, ...) |
-| [field(path)](./firestore_pipelines.md#field_34ee07d) | (Public Preview) Creates a instance representing the field at the given path. |
-| function(pipeline, ...) |
-| [execute(pipeline)](./firestore_pipelines.md#execute_01df620) | (Public Preview) Executes a pipeline and returns a Promise to represent the asynchronous operation.The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.The pipeline results are returned as a that contains a list of objects. Each typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example: Example:
-```typescript
-const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
- .where(gt(field("rating"), 4.5))
- .select("title", "author", "rating"));
-
-const results: PipelineResults = snapshot.results;
-
-```
- |
-| function(stringExpression, ...) |
-| [charLength(stringExpression)](./firestore_pipelines.md#charlength_c25a54a) | (Public Preview) Creates an expression that calculates the character length of a string expression in UTF-8.
-```typescript
-// Get the character length of the 'name' field in UTF-8.
-strLength(field("name"));
-
-```
- |
-| [endsWith(stringExpression, suffix)](./firestore_pipelines.md#endswith_0a0b889) | (Public Preview) Creates an expression that checks if a string expression ends with a given postfix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr."
-endsWith(field("fullName"), "Jr.");
-
-```
- |
-| [endsWith(stringExpression, suffix)](./firestore_pipelines.md#endswith_13aee0d) | (Public Preview) Creates an expression that checks if a string expression ends with a given postfix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields ends with "Jr."
-endsWith(field("fullName"), constant("Jr."));
-
-```
- |
-| [like(stringExpression, pattern)](./firestore_pipelines.md#like_a84c581) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like(field("title"), "%guide%");
-
-```
- |
-| [like(stringExpression, pattern)](./firestore_pipelines.md#like_b534848) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like(field("title"), field("pattern"));
-
-```
- |
-| [regexContains(stringExpression, pattern)](./firestore_pipelines.md#regexcontains_a84c581) | (Public Preview) Creates an expression that checks if a string expression contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains(field("description"), "(?i)example");
-
-```
- |
-| [regexContains(stringExpression, pattern)](./firestore_pipelines.md#regexcontains_b534848) | (Public Preview) Creates an expression that checks if a string expression contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains(field("description"), field("pattern"));
-
-```
- |
-| [regexMatch(stringExpression, pattern)](./firestore_pipelines.md#regexmatch_a84c581) | (Public Preview) Creates an expression that checks if a string expression matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch(field("email"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
-
-```
- |
-| [regexMatch(stringExpression, pattern)](./firestore_pipelines.md#regexmatch_b534848) | (Public Preview) Creates an expression that checks if a string expression matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch(field("email"), field("pattern"));
-
-```
- |
-| [reverse(stringExpression)](./firestore_pipelines.md#reverse_c25a54a) | (Public Preview) Creates an expression that reverses a string.
-```typescript
-// Reverse the value of the 'myString' field.
-reverse(field("myString"));
-
-```
- |
-| [startsWith(stringExpression, prefix)](./firestore_pipelines.md#startswith_75c3dbb) | (Public Preview) Creates an expression that checks if a string expression starts with a given prefix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr."
-startsWith(field("fullName"), "Mr.");
-
-```
- |
-| [startsWith(stringExpression, prefix)](./firestore_pipelines.md#startswith_52f218a) | (Public Preview) Creates an expression that checks if a string expression starts with a given prefix.
-```typescript
-// Check if the result of concatenating 'firstName' and 'lastName' fields starts with "Mr."
-startsWith(field("fullName"), field("prefix"));
-
-```
- |
-| [stringContains(stringExpression, substring)](./firestore_pipelines.md#stringcontains_3e9ff32) | (Public Preview) Creates an expression that checks if a string expression contains a specified substring.
-```typescript
-// Check if the 'description' field contains "example".
-stringContains(field("description"), "example");
-
-```
- |
-| [stringContains(stringExpression, substring)](./firestore_pipelines.md#stringcontains_cc6ee02) | (Public Preview) Creates an expression that checks if a string expression contains a substring specified by another expression.
-```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-stringContains(field("description"), field("keyword"));
-
-```
- |
-| [stringReverse(stringExpression)](./firestore_pipelines.md#stringreverse_c25a54a) | (Public Preview) Creates an expression that reverses a string.
-```typescript
-// Reverse the value of the 'myString' field.
-strReverse(field("myString"));
-
-```
- |
-| [toLower(stringExpression)](./firestore_pipelines.md#tolower_c25a54a) | (Public Preview) Creates an expression that converts a string expression to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-toLower(field("name"));
-
-```
- |
-| [toUpper(stringExpression)](./firestore_pipelines.md#toupper_c25a54a) | (Public Preview) Creates an expression that converts a string expression to uppercase.
-```typescript
-// Convert the 'title' field to uppercase
-toUppercase(field("title"));
-
-```
- |
-| [trim(stringExpression, valueToTrim)](./firestore_pipelines.md#trim_dd54322) | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array expression.
-```typescript
-// Trim whitespace from the 'userInput' field
-trim(field("userInput"));
-
-// Trim quotes from the 'userInput' field
-trim(field("userInput"), '"');
-
-```
- |
-| function(timestamp, ...) |
-| [timestampAdd(timestamp, unit, amount)](./firestore_pipelines.md#timestampadd_98418f9) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp.
-```typescript
-// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
-timestampAdd(field("timestamp"), field("unit"), field("amount"));
-
-```
- |
-| [timestampAdd(timestamp, unit, amount)](./firestore_pipelines.md#timestampadd_ffe8e57) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp.
-```typescript
-// Add 1 day to the 'timestamp' field.
-timestampAdd(field("timestamp"), "day", 1);
-
-```
- |
-| [timestampSubtract(timestamp, unit, amount)](./firestore_pipelines.md#timestampsubtract_98418f9) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp.
-```typescript
-// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
-timestampSubtract(field("timestamp"), field("unit"), field("amount"));
-
-```
- |
-| [timestampSubtract(timestamp, unit, amount)](./firestore_pipelines.md#timestampsubtract_ffe8e57) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp.
-```typescript
-// Subtract 1 day from the 'timestamp' field.
-timestampSubtract(field("timestamp"), "day", 1);
-
-```
- |
+| [mapGet(mapExpression, subField)](./firestore_pipelines.md#mapget_688c050) | (Public Preview) Accesses a value from a map (object) expression using the provided key. |
+| function(mapField, ...) |
+| [mapMerge(mapField, secondMap, otherMaps)](./firestore_pipelines.md#mapmerge_70a564b) | (Public Preview) Creates an expression that merges multiple map values. |
+| [mapRemove(mapField, key)](./firestore_pipelines.md#mapremove_bd5726e) | (Public Preview) Creates an expression that removes a key from the map at the specified field name. |
+| [mapRemove(mapField, keyExpr)](./firestore_pipelines.md#mapremove_8406d13) | (Public Preview) Creates an expression that removes a key from the map at the specified field name. |
+| function(name, ...) |
+| [field(name)](./firestore_pipelines.md#field_1eaaff4) | (Public Preview) Creates a [Field](./firestore_pipelines.field.md#field_class) instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city"). |
+| function(options, ...) |
+| [execute(options)](./firestore_pipelines.md#execute_9e87e31) | (Public Preview) Executes a pipeline and returns a Promise to represent the asynchronous operation.The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.The pipeline results are returned as a [PipelineSnapshot](./firestore_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) that contains a list of [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example: Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines. You can create a Field references are used to access document field values in expressions and to specify fields for sorting, filtering, and projecting data in Firestore pipelines. You can create a If the PipelineResult represents a non-document result, If the PipelineResult represents a non-document result, Example:
-
-```typescript
-const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
- .where(gt(field("rating"), 4.5))
- .select("title", "author", "rating"));
-
-const results: PipelineResults = snapshot.results;
+The pipeline results are returned as a [PipelineSnapshot](./firestore_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) that contains a list of [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:
-```
+ Example:
```typescript
const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
@@ -8146,30 +7705,35 @@ const results: PipelineResults = snapshot.results;
```
+## function(stringExpression, ...)
+
+### charLength(stringExpression) {:#charlength_c25a54a}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the character length of a string expression in UTF-8.
+
Signature:
```typescript
-export declare function execute(pipeline: Pipeline): Promise If the PipelineResult represents a non-document result, `ref` will return a undefined value.
@@ -27,10 +27,10 @@ export declare class PipelineResult Example:
- *
+ * @example
* ```typescript
* const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
* .where(gt(field("rating"), 4.5))
@@ -84,8 +83,8 @@ declare module './database' {
* const results: PipelineResults = snapshot.results;
* ```
*
- * @param pipeline The pipeline to execute.
- * @return A Promise representing the asynchronous pipeline execution.
+ * @param pipeline - The pipeline to execute.
+ * @returns A Promise representing the asynchronous pipeline execution.
*/
export function execute(pipeline: LitePipeline): Promise Example:
- *
+ * @example
* ```typescript
* const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
* .where(gt(field("rating"), 4.5))
@@ -120,8 +118,8 @@ export function execute(pipeline: LitePipeline): Promise Field references are used to access document field values in expressions and to specify fields
* for sorting, filtering, and projecting data in Firestore pipelines.
*
- * You can create a `Field` instance using the static {@link #of} method:
+ * You can create a `Field` instance using the static {@link @firebase/firestore/pipelines#field} method:
*
+ * @example
* ```typescript
* // Create a Field instance for the 'name' field
* const nameField = field("name");
@@ -2654,11 +2770,12 @@ export class Field extends Expression implements Selectable {
/**
* @beta
- * Creates a {@code Field} instance representing the field at the given path.
+ * Creates a {@link @firebase/firestore/pipelines#Field} instance representing the field at the given path.
*
* The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field
* (e.g., "address.city").
*
+ * @example
* ```typescript
* // Create a Field instance for the 'title' field
* const titleField = field("title");
@@ -2667,17 +2784,17 @@ export class Field extends Expression implements Selectable {
* const authorFirstNameField = field("author.firstName");
* ```
*
- * @param name The path to the field.
- * @return A new {@code Field} instance representing the specified field.
+ * @param name - The path to the field.
+ * @returns A new {@link @firebase/firestore/pipelines#Field} instance representing the specified field.
*/
export function field(name: string): Field;
/**
* @beta
- * Creates a {@code Field} instance representing the field at the given path.
+ * Creates a {@link @firebase/firestore/pipelines#Field} instance representing the field at the given path.
*
- * @param path A FieldPath specifying the field.
- * @return A new {@code Field} instance representing the specified field.
+ * @param path - A FieldPath specifying the field.
+ * @returns A new {@link @firebase/firestore/pipelines#Field} instance representing the specified field.
*/
export function field(path: FieldPath): Field;
export function field(nameOrPath: string | FieldPath): Field {
@@ -2703,8 +2820,9 @@ export function _field(
*
* Represents a constant value that can be used in a Firestore pipeline expression.
*
- * You can create a `Constant` instance using the static {@link #of} method:
+ * You can create a `Constant` instance using the static {@link @firebase/firestore/pipelines#field} method:
*
+ * @example
* ```typescript
* // Create a Constant instance for the number 10
* const ten = constant(10);
@@ -2722,7 +2840,7 @@ export class Constant extends Expression {
* @private
* @internal
* @hideconstructor
- * @param value The value of the constant.
+ * @param value - The value of the constant.
*/
constructor(
private value: unknown,
@@ -2774,8 +2892,8 @@ export class Constant extends Expression {
* @beta
* Creates a `Constant` instance for a number value.
*
- * @param value The number value.
- * @return A new `Constant` instance.
+ * @param value - The number value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: number): Expression;
@@ -2783,8 +2901,8 @@ export function constant(value: number): Expression;
* @beta
* Creates a `Constant` instance for a string value.
*
- * @param value The string value.
- * @return A new `Constant` instance.
+ * @param value - The string value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: string): Expression;
@@ -2792,8 +2910,8 @@ export function constant(value: string): Expression;
* @beta
* Creates a `BooleanExpression` instance for a boolean value.
*
- * @param value The boolean value.
- * @return A new `Constant` instance.
+ * @param value - The boolean value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: boolean): BooleanExpression;
@@ -2801,8 +2919,8 @@ export function constant(value: boolean): BooleanExpression;
* @beta
* Creates a `Constant` instance for a null value.
*
- * @param value The null value.
- * @return A new `Constant` instance.
+ * @param value - The null value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: null): Expression;
@@ -2810,8 +2928,8 @@ export function constant(value: null): Expression;
* @beta
* Creates a `Constant` instance for a GeoPoint value.
*
- * @param value The GeoPoint value.
- * @return A new `Constant` instance.
+ * @param value - The GeoPoint value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: GeoPoint): Expression;
@@ -2819,8 +2937,8 @@ export function constant(value: GeoPoint): Expression;
* @beta
* Creates a `Constant` instance for a Timestamp value.
*
- * @param value The Timestamp value.
- * @return A new `Constant` instance.
+ * @param value - The Timestamp value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: Timestamp): Expression;
@@ -2828,8 +2946,8 @@ export function constant(value: Timestamp): Expression;
* @beta
* Creates a `Constant` instance for a Date value.
*
- * @param value The Date value.
- * @return A new `Constant` instance.
+ * @param value - The Date value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: Date): Expression;
@@ -2837,8 +2955,8 @@ export function constant(value: Date): Expression;
* @beta
* Creates a `Constant` instance for a Bytes value.
*
- * @param value The Bytes value.
- * @return A new `Constant` instance.
+ * @param value - The Bytes value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: Bytes): Expression;
@@ -2846,8 +2964,8 @@ export function constant(value: Bytes): Expression;
* @beta
* Creates a `Constant` instance for a DocumentReference value.
*
- * @param value The DocumentReference value.
- * @return A new `Constant` instance.
+ * @param value - The DocumentReference value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: DocumentReference): Expression;
@@ -2856,8 +2974,8 @@ export function constant(value: DocumentReference): Expression;
* For internal use only.
* @private
* @internal
- * @param value The Firestore proto value.
- * @return A new `Constant` instance.
+ * @param value - The Firestore proto value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: ProtoValue): Expression;
@@ -2865,8 +2983,8 @@ export function constant(value: ProtoValue): Expression;
* @beta
* Creates a `Constant` instance for a VectorValue value.
*
- * @param value The VectorValue value.
- * @return A new `Constant` instance.
+ * @param value - The VectorValue value.
+ * @returns A new `Constant` instance.
*/
export function constant(value: VectorValue): Expression;
@@ -2924,11 +3042,11 @@ export class MapValue extends Expression {
/**
* @beta
*
- * This class defines the base class for Firestore {@link Pipeline} functions, which can be evaluated within pipeline
+ * This class defines the base class for Firestore {@link @firebase/firestore/pipelines#Pipeline} functions, which can be evaluated within pipeline
* execution.
*
- * Typically, you would not use this class or its children directly. Use either the functions like {@link and}, {@link equal},
- * or the methods on {@link Expression} ({@link Expression#equal}, {@link Expression#lessThan}, etc.) to construct new Function instances.
+ * Typically, you would not use this class or its children directly. Use either the functions like {@link @firebase/firestore/pipelines#and}, {@link @firebase/firestore/pipelines#(equal:1)},
+ * or the methods on {@link @firebase/firestore/pipelines#Expression} ({@link @firebase/firestore/pipelines#Expression.(equal:1)}, {@link @firebase/firestore/pipelines#Expression.(lessThan:1)}, etc.) to construct new Function instances.
*/
export class FunctionExpression extends Expression {
readonly expressionType: ExpressionType = 'Function';
@@ -2991,12 +3109,13 @@ export abstract class BooleanExpression extends Expression {
* Creates an aggregation that finds the count of input documents satisfying
* this boolean expression.
*
+ * @example
* ```typescript
* // Find the count of documents with a score greater than 90
* field("score").greaterThan(90).countIf().as("highestScore");
* ```
*
- * @return A new `AggregateFunction` representing the 'countIf' aggregation.
+ * @returns A new `AggregateFunction` representing the 'countIf' aggregation.
*/
countIf(): AggregateFunction {
return AggregateFunction._create('count_if', [this], 'countIf');
@@ -3006,12 +3125,13 @@ export abstract class BooleanExpression extends Expression {
* @beta
* Creates an expression that negates this boolean expression.
*
+ * @example
* ```typescript
* // Find documents where the 'tags' field does not contain 'completed'
* field("tags").arrayContains("completed").not();
* ```
*
- * @return A new {@code Expr} representing the negated filter condition.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the negated filter condition.
*/
not(): BooleanExpression {
return new FunctionExpression('not', [this], 'not').asBoolean();
@@ -3023,14 +3143,15 @@ export abstract class BooleanExpression extends Expression {
* if `this` expression evaluates to `true`,
* or evaluates to the 'else' expression if `this` expressions evaluates `false`.
*
+ * @example
* ```typescript
* // If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
* field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
* ```
*
- * @param thenExpr The expression to evaluate if the condition is true.
- * @param elseExpr The expression to evaluate if the condition is false.
- * @return A new {@code Expr} representing the conditional expression.
+ * @param thenExpr - The expression to evaluate if the condition is true.
+ * @param elseExpr - The expression to evaluate if the condition is false.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the conditional expression.
*/
conditional(thenExpr: Expression, elseExpr: Expression): FunctionExpression {
return new FunctionExpression(
@@ -3046,15 +3167,16 @@ export abstract class BooleanExpression extends Expression {
* Creates an expression that returns the `catch` argument if there is an
* error, else return the result of this expression.
*
+ * @example
* ```typescript
* // Create an expression that protects against a divide by zero error
* // but always returns a boolean expression.
* constant(50).divide('length').gt(1).ifError(constant(false));
* ```
*
- * @param catchValue The value that will be returned if this expression
+ * @param catchValue - The value that will be returned if this expression
* produces an error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
ifError(catchValue: BooleanExpression): BooleanExpression;
@@ -3064,15 +3186,16 @@ export abstract class BooleanExpression extends Expression {
* Creates an expression that returns the `catch` argument if there is an
* error, else return the result of this expression.
*
+ * @example
* ```typescript
* // Create an expression that protects against a divide by zero error
* // but always returns a boolean expression.
* constant(50).divide('length').gt(1).ifError(false);
* ```
*
- * @param catchValue The value that will be returned if this expression
+ * @param catchValue - The value that will be returned if this expression
* produces an error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
ifError(catchValue: boolean): BooleanExpression;
@@ -3082,14 +3205,15 @@ export abstract class BooleanExpression extends Expression {
* Creates an expression that returns the `catch` argument if there is an
* error, else return the result of this expression.
*
+ * @example
* ```typescript
* // Create an expression that protects against a divide by zero error.
* constant(50).divide('length').gt(1).ifError(constant(0));
* ```
*
- * @param catchValue The value that will be returned if this expression
+ * @param catchValue - The value that will be returned if this expression
* produces an error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
ifError(catchValue: Expression): FunctionExpression;
@@ -3099,14 +3223,15 @@ export abstract class BooleanExpression extends Expression {
* Creates an expression that returns the `catch` argument if there is an
* error, else return the result of this expression.
*
+ * @example
* ```typescript
* // Create an expression that protects against a divide by zero error.
* constant(50).divide('length').gt(1).ifError(0);
* ```
*
- * @param catchValue The value that will be returned if this expression
+ * @param catchValue - The value that will be returned if this expression
* produces an error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
ifError(catchValue: unknown): FunctionExpression;
ifError(catchValue: unknown): unknown {
@@ -3165,6 +3290,7 @@ export class BooleanField extends BooleanExpression {
* Creates an aggregation that counts the number of stage inputs where the provided
* boolean expression evaluates to true.
*
+ * @example
* ```typescript
* // Count the number of documents where 'is_active' field equals true
* countIf(field("is_active").equal(true)).as("numActiveDocuments");
@@ -3183,14 +3309,15 @@ export function countIf(booleanExpr: BooleanExpression): AggregateFunction {
* and return the element. If the offset exceeds the array length, an error is
* returned. A negative offset, starts from the end.
*
+ * @example
* ```typescript
* // Return the value in the tags field array at index 1.
* arrayGet('tags', 1);
* ```
*
- * @param arrayField The name of the array field.
- * @param offset The index of the element to return.
- * @return A new Expr representing the 'arrayGet' operation.
+ * @param arrayField - The name of the array field.
+ * @param offset - The index of the element to return.
+ * @returns A new `Expression` representing the 'arrayGet' operation.
*/
export function arrayGet(
arrayField: string,
@@ -3203,15 +3330,16 @@ export function arrayGet(
* and return the element. If the offset exceeds the array length, an error is
* returned. A negative offset, starts from the end.
*
+ * @example
* ```typescript
* // Return the value in the tags field array at index specified by field
* // 'favoriteTag'.
* arrayGet('tags', field('favoriteTag'));
* ```
*
- * @param arrayField The name of the array field.
- * @param offsetExpr An Expr evaluating to the index of the element to return.
- * @return A new Expr representing the 'arrayGet' operation.
+ * @param arrayField - The name of the array field.
+ * @param offsetExpr - An `Expression` evaluating to the index of the element to return.
+ * @returns A new `Expression` representing the 'arrayGet' operation.
*/
export function arrayGet(
arrayField: string,
@@ -3224,14 +3352,15 @@ export function arrayGet(
* and return the element. If the offset exceeds the array length, an error is
* returned. A negative offset, starts from the end.
*
+ * @example
* ```typescript
* // Return the value in the tags field array at index 1.
* arrayGet(field('tags'), 1);
* ```
*
- * @param arrayExpression An Expr evaluating to an array.
- * @param offset The index of the element to return.
- * @return A new Expr representing the 'arrayGet' operation.
+ * @param arrayExpression - An `Expression` evaluating to an array.
+ * @param offset - The index of the element to return.
+ * @returns A new `Expression` representing the 'arrayGet' operation.
*/
export function arrayGet(
arrayExpression: Expression,
@@ -3244,15 +3373,16 @@ export function arrayGet(
* and return the element. If the offset exceeds the array length, an error is
* returned. A negative offset, starts from the end.
*
+ * @example
* ```typescript
* // Return the value in the tags field array at index specified by field
* // 'favoriteTag'.
* arrayGet(field('tags'), field('favoriteTag'));
* ```
*
- * @param arrayExpression An Expr evaluating to an array.
- * @param offsetExpr An Expr evaluating to the index of the element to return.
- * @return A new Expr representing the 'arrayGet' operation.
+ * @param arrayExpression - An `Expression` evaluating to an array.
+ * @param offsetExpr - An `Expression` evaluating to the index of the element to return.
+ * @returns A new `Expression` representing the 'arrayGet' operation.
*/
export function arrayGet(
arrayExpression: Expression,
@@ -3270,13 +3400,14 @@ export function arrayGet(
*
* Creates an expression that checks if a given expression produces an error.
*
+ * @example
* ```typescript
* // Check if the result of a calculation is an error
* isError(field("title").arrayContains(1));
* ```
*
- * @param value The expression to check.
- * @return A new {@code Expr} representing the 'isError' check.
+ * @param value - The expression to check.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'isError' check.
*/
export function isError(value: Expression): BooleanExpression {
return value.isError().asBoolean();
@@ -3290,16 +3421,17 @@ export function isError(value: Expression): BooleanExpression {
*
* This overload is useful when a BooleanExpression is required.
*
+ * @example
* ```typescript
* // Create an expression that protects against a divide by zero error
* // but always returns a boolean expression.
* ifError(constant(50).divide('length').gt(1), constant(false));
* ```
*
- * @param tryExpr The try expression.
- * @param catchExpr The catch expression that will be evaluated and
+ * @param tryExpr - The try expression.
+ * @param catchExpr - The catch expression that will be evaluated and
* returned if the tryExpr produces an error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
export function ifError(
tryExpr: BooleanExpression,
@@ -3312,16 +3444,17 @@ export function ifError(
* Creates an expression that returns the `catch` argument if there is an
* error, else return the result of the `try` argument evaluation.
*
+ * @example
* ```typescript
* // Returns the first item in the title field arrays, or returns
* // the entire title field if the array is empty or the field is another type.
* ifError(field("title").arrayGet(0), field("title"));
* ```
*
- * @param tryExpr The try expression.
- * @param catchExpr The catch expression that will be evaluated and
+ * @param tryExpr - The try expression.
+ * @param catchExpr - The catch expression that will be evaluated and
* returned if the tryExpr produces an error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
export function ifError(
tryExpr: Expression,
@@ -3334,16 +3467,17 @@ export function ifError(
* Creates an expression that returns the `catch` argument if there is an
* error, else return the result of the `try` argument evaluation.
*
+ * @example
* ```typescript
* // Returns the first item in the title field arrays, or returns
* // "Default Title"
* ifError(field("title").arrayGet(0), "Default Title");
* ```
*
- * @param tryExpr The try expression.
- * @param catchValue The value that will be returned if the tryExpr produces an
+ * @param tryExpr - The try expression.
+ * @param catchValue - The value that will be returned if the tryExpr produces an
* error.
- * @return A new {@code Expr} representing the 'ifError' operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'ifError' operation.
*/
export function ifError(
tryExpr: Expression,
@@ -3370,13 +3504,14 @@ export function ifError(
* Creates an expression that returns `true` if a value is absent. Otherwise,
* returns `false` even if the value is `null`.
*
+ * @example
* ```typescript
* // Check if the field `value` is absent.
* isAbsent(field("value"));
* ```
*
- * @param value The expression to check.
- * @return A new {@code Expr} representing the 'isAbsent' check.
+ * @param value - The expression to check.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'isAbsent' check.
*/
export function isAbsent(value: Expression): BooleanExpression;
@@ -3386,13 +3521,14 @@ export function isAbsent(value: Expression): BooleanExpression;
* Creates an expression that returns `true` if a field is absent. Otherwise,
* returns `false` even if the field value is `null`.
*
+ * @example
* ```typescript
* // Check if the field `value` is absent.
* isAbsent("value");
* ```
*
- * @param field The field to check.
- * @return A new {@code Expr} representing the 'isAbsent' check.
+ * @param field - The field to check.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the 'isAbsent' check.
*/
export function isAbsent(field: string): BooleanExpression;
export function isAbsent(value: Expression | string): BooleanExpression {
@@ -3404,13 +3540,14 @@ export function isAbsent(value: Expression | string): BooleanExpression {
*
* Creates an expression that removes a key from the map at the specified field name.
*
+ * @example
* ```
* // Removes the key 'city' field from the map in the address field of the input document.
* mapRemove('address', 'city');
* ```
*
- * @param mapField The name of a field containing a map value.
- * @param key The name of the key to remove from the input map.
+ * @param mapField - The name of a field containing a map value.
+ * @param key - The name of the key to remove from the input map.
*/
export function mapRemove(mapField: string, key: string): FunctionExpression;
/**
@@ -3418,13 +3555,15 @@ export function mapRemove(mapField: string, key: string): FunctionExpression;
*
* Creates an expression that removes a key from the map produced by evaluating an expression.
*
+ * @example
* ```
* // Removes the key 'baz' from the input map.
* mapRemove(map({foo: 'bar', baz: true}), 'baz');
+ * @example
* ```
*
- * @param mapExpr An expression return a map value.
- * @param key The name of the key to remove from the input map.
+ * @param mapExpr - An expression return a map value.
+ * @param key - The name of the key to remove from the input map.
*/
export function mapRemove(mapExpr: Expression, key: string): FunctionExpression;
/**
@@ -3432,13 +3571,14 @@ export function mapRemove(mapExpr: Expression, key: string): FunctionExpression;
*
* Creates an expression that removes a key from the map at the specified field name.
*
+ * @example
* ```
* // Removes the key 'city' field from the map in the address field of the input document.
* mapRemove('address', constant('city'));
* ```
*
- * @param mapField The name of a field containing a map value.
- * @param keyExpr An expression that produces the name of the key to remove from the input map.
+ * @param mapField - The name of a field containing a map value.
+ * @param keyExpr - An expression that produces the name of the key to remove from the input map.
*/
export function mapRemove(
mapField: string,
@@ -3449,13 +3589,15 @@ export function mapRemove(
*
* Creates an expression that removes a key from the map produced by evaluating an expression.
*
+ * @example
* ```
* // Removes the key 'baz' from the input map.
* mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
+ * @example
* ```
*
- * @param mapExpr An expression return a map value.
- * @param keyExpr An expression that produces the name of the key to remove from the input map.
+ * @param mapExpr - An expression return a map value.
+ * @param keyExpr - An expression that produces the name of the key to remove from the input map.
*/
export function mapRemove(
mapExpr: Expression,
@@ -3474,16 +3616,17 @@ export function mapRemove(
*
* Creates an expression that merges multiple map values.
*
+ * @example
* ```
* // Merges the map in the settings field with, a map literal, and a map in
* // that is conditionally returned by another expression
* mapMerge('settings', { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
* ```
*
- * @param mapField Name of a field containing a map value that will be merged.
- * @param secondMap A required second map to merge. Represented as a literal or
+ * @param mapField - Name of a field containing a map value that will be merged.
+ * @param secondMap - A required second map to merge. Represented as a literal or
* an expression that returns a map.
- * @param otherMaps Optional additional maps to merge. Each map is represented
+ * @param otherMaps - Optional additional maps to merge. Each map is represented
* as a literal or an expression that returns a map.
*/
export function mapMerge(
@@ -3497,16 +3640,17 @@ export function mapMerge(
*
* Creates an expression that merges multiple map values.
*
+ * @example
* ```
* // Merges the map in the settings field with, a map literal, and a map in
* // that is conditionally returned by another expression
* mapMerge(field('settings'), { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
* ```
*
- * @param firstMap An expression or literal map value that will be merged.
- * @param secondMap A required second map to merge. Represented as a literal or
+ * @param firstMap - An expression or literal map value that will be merged.
+ * @param secondMap - A required second map to merge. Represented as a literal or
* an expression that returns a map.
- * @param otherMaps Optional additional maps to merge. Each map is represented
+ * @param otherMaps - Optional additional maps to merge. Each map is represented
* as a literal or an expression that returns a map.
*/
export function mapMerge(
@@ -3530,12 +3674,13 @@ export function mapMerge(
*
* Creates an expression that returns the document ID from a path.
*
+ * @example
* ```typescript
* // Get the document ID from a path.
* documentId(myDocumentReference);
* ```
*
- * @return A new {@code Expr} representing the documentId operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the documentId operation.
*/
export function documentId(
documentPath: string | DocumentReference
@@ -3546,12 +3691,13 @@ export function documentId(
*
* Creates an expression that returns the document ID from a path.
*
+ * @example
* ```typescript
* // Get the document ID from a path.
* documentId(field("__path__"));
* ```
*
- * @return A new {@code Expr} representing the documentId operation.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the documentId operation.
*/
export function documentId(documentPathExpr: Expression): FunctionExpression;
@@ -3568,9 +3714,9 @@ export function documentId(
*
* Creates an expression that returns a substring of a string or byte array.
*
- * @param field The name of a field containing a string or byte array to compute the substring from.
- * @param position Index of the first character of the substring.
- * @param length Length of the substring.
+ * @param field - The name of a field containing a string or byte array to compute the substring from.
+ * @param position - Index of the first character of the substring.
+ * @param length - Length of the substring.
*/
export function substring(
field: string,
@@ -3583,9 +3729,9 @@ export function substring(
*
* Creates an expression that returns a substring of a string or byte array.
*
- * @param input An expression returning a string or byte array to compute the substring from.
- * @param position Index of the first character of the substring.
- * @param length Length of the substring.
+ * @param input - An expression returning a string or byte array to compute the substring from.
+ * @param position - Index of the first character of the substring.
+ * @param length - Length of the substring.
*/
export function substring(
input: Expression,
@@ -3598,9 +3744,9 @@ export function substring(
*
* Creates an expression that returns a substring of a string or byte array.
*
- * @param field The name of a field containing a string or byte array to compute the substring from.
- * @param position An expression that returns the index of the first character of the substring.
- * @param length An expression that returns the length of the substring.
+ * @param field - The name of a field containing a string or byte array to compute the substring from.
+ * @param position - An expression that returns the index of the first character of the substring.
+ * @param length - An expression that returns the length of the substring.
*/
export function substring(
field: string,
@@ -3613,9 +3759,9 @@ export function substring(
*
* Creates an expression that returns a substring of a string or byte array.
*
- * @param input An expression returning a string or byte array to compute the substring from.
- * @param position An expression that returns the index of the first character of the substring.
- * @param length An expression that returns the length of the substring.
+ * @param input - An expression returning a string or byte array to compute the substring from.
+ * @param position - An expression that returns the index of the first character of the substring.
+ * @param length - An expression that returns the length of the substring.
*/
export function substring(
input: Expression,
@@ -3640,15 +3786,16 @@ export function substring(
*
* Creates an expression that adds two expressions together.
*
+ * @example
* ```typescript
* // Add the value of the 'quantity' field and the 'reserve' field.
* add(field("quantity"), field("reserve"));
* ```
*
- * @param first The first expression to add.
- * @param second The second expression or literal to add.
- * @param others Optional other expressions or literals to add.
- * @return A new {@code Expr} representing the addition operation.
+ * @param first - The first expression to add.
+ * @param second - The second expression or literal to add.
+ * @param others - Optional other expressions or literals to add.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the addition operation.
*/
export function add(
first: Expression,
@@ -3660,15 +3807,16 @@ export function add(
*
* Creates an expression that adds a field's value to an expression.
*
+ * @example
* ```typescript
* // Add the value of the 'quantity' field and the 'reserve' field.
* add("quantity", field("reserve"));
* ```
*
- * @param fieldName The name of the field containing the value to add.
- * @param second The second expression or literal to add.
- * @param others Optional other expressions or literals to add.
- * @return A new {@code Expr} representing the addition operation.
+ * @param fieldName - The name of the field containing the value to add.
+ * @param second - The second expression or literal to add.
+ * @param others - Optional other expressions or literals to add.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the addition operation.
*/
export function add(
fieldName: string,
@@ -3687,14 +3835,15 @@ export function add(
*
* Creates an expression that subtracts two expressions.
*
+ * @example
* ```typescript
* // Subtract the 'discount' field from the 'price' field
* subtract(field("price"), field("discount"));
* ```
*
- * @param left The expression to subtract from.
- * @param right The expression to subtract.
- * @return A new {@code Expr} representing the subtraction operation.
+ * @param left - The expression to subtract from.
+ * @param right - The expression to subtract.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the subtraction operation.
*/
export function subtract(
left: Expression,
@@ -3706,14 +3855,15 @@ export function subtract(
*
* Creates an expression that subtracts a constant value from an expression.
*
+ * @example
* ```typescript
* // Subtract the constant value 2 from the 'value' field
* subtract(field("value"), 2);
* ```
*
- * @param expression The expression to subtract from.
- * @param value The constant value to subtract.
- * @return A new {@code Expr} representing the subtraction operation.
+ * @param expression - The expression to subtract from.
+ * @param value - The constant value to subtract.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the subtraction operation.
*/
export function subtract(
expression: Expression,
@@ -3725,14 +3875,15 @@ export function subtract(
*
* Creates an expression that subtracts an expression from a field's value.
*
+ * @example
* ```typescript
* // Subtract the 'discount' field from the 'price' field
* subtract("price", field("discount"));
* ```
*
- * @param fieldName The field name to subtract from.
- * @param expression The expression to subtract.
- * @return A new {@code Expr} representing the subtraction operation.
+ * @param fieldName - The field name to subtract from.
+ * @param expression - The expression to subtract.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the subtraction operation.
*/
export function subtract(
fieldName: string,
@@ -3744,14 +3895,15 @@ export function subtract(
*
* Creates an expression that subtracts a constant value from a field's value.
*
+ * @example
* ```typescript
* // Subtract 20 from the value of the 'total' field
* subtract("total", 20);
* ```
*
- * @param fieldName The field name to subtract from.
- * @param value The constant value to subtract.
- * @return A new {@code Expr} representing the subtraction operation.
+ * @param fieldName - The field name to subtract from.
+ * @param value - The constant value to subtract.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the subtraction operation.
*/
export function subtract(fieldName: string, value: unknown): FunctionExpression;
export function subtract(
@@ -3768,15 +3920,16 @@ export function subtract(
*
* Creates an expression that multiplies two expressions together.
*
+ * @example
* ```typescript
* // Multiply the 'quantity' field by the 'price' field
* multiply(field("quantity"), field("price"));
* ```
*
- * @param first The first expression to multiply.
- * @param second The second expression or literal to multiply.
- * @param others Optional additional expressions or literals to multiply.
- * @return A new {@code Expr} representing the multiplication operation.
+ * @param first - The first expression to multiply.
+ * @param second - The second expression or literal to multiply.
+ * @param others - Optional additional expressions or literals to multiply.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the multiplication operation.
*/
export function multiply(
first: Expression,
@@ -3788,15 +3941,16 @@ export function multiply(
*
* Creates an expression that multiplies a field's value by an expression.
*
+ * @example
* ```typescript
* // Multiply the 'quantity' field by the 'price' field
* multiply("quantity", field("price"));
* ```
*
- * @param fieldName The name of the field containing the value to add.
- * @param second The second expression or literal to add.
- * @param others Optional other expressions or literals to add.
- * @return A new {@code Expr} representing the multiplication operation.
+ * @param fieldName - The name of the field containing the value to add.
+ * @param second - The second expression or literal to add.
+ * @param others - Optional other expressions or literals to add.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the multiplication operation.
*/
export function multiply(
fieldName: string,
@@ -3815,14 +3969,15 @@ export function multiply(
*
* Creates an expression that divides two expressions.
*
+ * @example
* ```typescript
* // Divide the 'total' field by the 'count' field
* divide(field("total"), field("count"));
* ```
*
- * @param left The expression to be divided.
- * @param right The expression to divide by.
- * @return A new {@code Expr} representing the division operation.
+ * @param left - The expression to be divided.
+ * @param right - The expression to divide by.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the division operation.
*/
export function divide(left: Expression, right: Expression): FunctionExpression;
@@ -3831,14 +3986,15 @@ export function divide(left: Expression, right: Expression): FunctionExpression;
*
* Creates an expression that divides an expression by a constant value.
*
+ * @example
* ```typescript
* // Divide the 'value' field by 10
* divide(field("value"), 10);
* ```
*
- * @param expression The expression to be divided.
- * @param value The constant value to divide by.
- * @return A new {@code Expr} representing the division operation.
+ * @param expression - The expression to be divided.
+ * @param value - The constant value to divide by.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the division operation.
*/
export function divide(
expression: Expression,
@@ -3850,14 +4006,15 @@ export function divide(
*
* Creates an expression that divides a field's value by an expression.
*
+ * @example
* ```typescript
* // Divide the 'total' field by the 'count' field
* divide("total", field("count"));
* ```
*
- * @param fieldName The field name to be divided.
- * @param expressions The expression to divide by.
- * @return A new {@code Expr} representing the division operation.
+ * @param fieldName - The field name to be divided.
+ * @param expressions - The expression to divide by.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the division operation.
*/
export function divide(
fieldName: string,
@@ -3869,14 +4026,15 @@ export function divide(
*
* Creates an expression that divides a field's value by a constant value.
*
+ * @example
* ```typescript
* // Divide the 'value' field by 10
* divide("value", 10);
* ```
*
- * @param fieldName The field name to be divided.
- * @param value The constant value to divide by.
- * @return A new {@code Expr} representing the division operation.
+ * @param fieldName - The field name to be divided.
+ * @param value - The constant value to divide by.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the division operation.
*/
export function divide(fieldName: string, value: unknown): FunctionExpression;
export function divide(
@@ -3893,14 +4051,15 @@ export function divide(
*
* Creates an expression that calculates the modulo (remainder) of dividing two expressions.
*
+ * @example
* ```typescript
* // Calculate the remainder of dividing 'field1' by 'field2'.
* mod(field("field1"), field("field2"));
* ```
*
- * @param left The dividend expression.
- * @param right The divisor expression.
- * @return A new {@code Expr} representing the modulo operation.
+ * @param left - The dividend expression.
+ * @param right - The divisor expression.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the modulo operation.
*/
export function mod(left: Expression, right: Expression): FunctionExpression;
@@ -3909,14 +4068,15 @@ export function mod(left: Expression, right: Expression): FunctionExpression;
*
* Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant.
*
+ * @example
* ```typescript
* // Calculate the remainder of dividing 'field1' by 5.
* mod(field("field1"), 5);
* ```
*
- * @param expression The dividend expression.
- * @param value The divisor constant.
- * @return A new {@code Expr} representing the modulo operation.
+ * @param expression - The dividend expression.
+ * @param value - The divisor constant.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the modulo operation.
*/
export function mod(expression: Expression, value: unknown): FunctionExpression;
@@ -3925,14 +4085,15 @@ export function mod(expression: Expression, value: unknown): FunctionExpression;
*
* Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression.
*
+ * @example
* ```typescript
* // Calculate the remainder of dividing 'field1' by 'field2'.
* mod("field1", field("field2"));
* ```
*
- * @param fieldName The dividend field name.
- * @param expression The divisor expression.
- * @return A new {@code Expr} representing the modulo operation.
+ * @param fieldName - The dividend field name.
+ * @param expression - The divisor expression.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the modulo operation.
*/
export function mod(
fieldName: string,
@@ -3944,14 +4105,15 @@ export function mod(
*
* Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant.
*
+ * @example
* ```typescript
* // Calculate the remainder of dividing 'field1' by 5.
* mod("field1", 5);
* ```
*
- * @param fieldName The dividend field name.
- * @param value The divisor constant.
- * @return A new {@code Expr} representing the modulo operation.
+ * @param fieldName - The dividend field name.
+ * @param value - The divisor constant.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the modulo operation.
*/
export function mod(fieldName: string, value: unknown): FunctionExpression;
export function mod(
@@ -3968,13 +4130,14 @@ export function mod(
*
* Creates an expression that creates a Firestore map value from an input object.
*
+ * @example
* ```typescript
* // Create a map from the input object and reference the 'baz' field value from the input document.
* map({foo: 'bar', baz: Field.of('baz')}).as('data');
* ```
*
- * @param elements The input map to evaluate in the expression.
- * @return A new {@code Expr} representing the map function.
+ * @param elements - The input map to evaluate in the expression.
+ * @returns A new {@link @firebase/firestore/pipelines#Expression} representing the map function.
*/
export function map(elements: Record If the PipelineResult represents a non-document result, `ref` will return a undefined
* value.
@@ -118,12 +117,12 @@ export class PipelineResult The selected fields are defined using {@link Selectable} expressions, which can be:
+ * The selected fields are defined using {@link @firebase/firestore/pipelines#Selectable} expressions, which can be:
*
* If no selections are provided, the output of this stage is empty. Use {@link
- * Pipeline#addFields} instead if only additions are
+ * @firebase/firestore/pipelines#Pipeline.(addFields:1)} instead if only additions are
* desired.
*
* Example:
*
+ * @example
* ```typescript
* db.pipeline().collection("books")
* .select(
@@ -350,11 +356,11 @@ export class Pipeline implements ProtoSerializable The selected fields are defined using {@link Selectable} expressions, which can be:
+ * The selected fields are defined using {@link @firebase/firestore/pipelines#Selectable} expressions, which can be:
*
* If no selections are provided, the output of this stage is empty. Use {@link
- * Pipeline#addFields} instead if only additions are
+ * @firebase/firestore/pipelines#Pipeline.(addFields:1)} instead if only additions are
* desired.
*
* Example:
*
+ * @example
* ```typescript
* db.pipeline().collection("books")
* .select(
@@ -389,7 +396,7 @@ export class Pipeline implements ProtoSerializable This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL.
* You can filter documents based on their field values, using implementations of {@link
- * BooleanExpression}, typically including but not limited to:
+ * @firebase/firestore/pipelines#BooleanExpression}, typically including but not limited to:
*
* Example:
*
+ * @example
* ```typescript
* firestore.pipeline().collection("books")
* .where(
@@ -455,29 +463,30 @@ export class Pipeline implements ProtoSerializable This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL.
* You can filter documents based on their field values, using implementations of {@link
- * BooleanExpression}, typically including but not limited to:
+ * @firebase/firestore/pipelines#BooleanExpression}, typically including but not limited to:
*
* Example:
*
+ * @example
* ```typescript
* firestore.pipeline().collection("books")
* .where(
@@ -489,7 +498,7 @@ export class Pipeline implements ProtoSerializable This stage is useful for implementing pagination in your pipelines, allowing you to retrieve
- * results in chunks. It is typically used in conjunction with {@link #limit} to control the
+ * results in chunks. It is typically used in conjunction with {@link @firebase/firestore/pipelines#Pipeline.limit} to control the
* size of each page.
*
* Example:
*
+ * @example
* ```typescript
* // Retrieve the second page of 20 results
* firestore.pipeline().collection('books')
@@ -532,8 +542,8 @@ export class Pipeline implements ProtoSerializable This stage is useful for implementing pagination in your pipelines, allowing you to retrieve
- * results in chunks. It is typically used in conjunction with {@link #limit} to control the
+ * results in chunks. It is typically used in conjunction with {@link @firebase/firestore/pipelines#Pipeline.limit} to control the
* size of each page.
*
* Example:
*
+ * @example
* ```typescript
* // Retrieve the second page of 20 results
* firestore.pipeline().collection('books')
@@ -555,7 +566,7 @@ export class Pipeline implements ProtoSerializable Example:
*
+ * @example
* ```typescript
* // Limit the results to the top 10 highest-rated books
* firestore.pipeline().collection('books')
@@ -608,8 +620,8 @@ export class Pipeline implements ProtoSerializable Example:
*
+ * @example
* ```typescript
* // Limit the results to the top 10 highest-rated books
* firestore.pipeline().collection('books')
@@ -636,7 +649,7 @@ export class Pipeline implements ProtoSerializable This stage allows you to calculate aggregate values over a set of documents. You define the
- * aggregations to perform using {@link AliasedAggregate} expressions which are typically results of
- * calling {@link Expression#as} on {@link AggregateFunction} instances.
+ * aggregations to perform using {@link @firebase/firestore/pipelines#AliasedAggregate} expressions which are typically results of
+ * calling {@link @firebase/firestore/pipelines#Expression.(as:1)} on {@link @firebase/firestore/pipelines#AggregateFunction} instances.
*
* Example:
*
+ * @example
* ```typescript
* // Calculate the average rating and the total number of books
* firestore.pipeline().collection("books")
@@ -772,11 +788,11 @@ export class Pipeline implements ProtoSerializable Example:
*
+ * @example
* ```typescript
* // Calculate the average rating for each genre.
* firestore.pipeline().collection("books")
@@ -812,7 +829,7 @@ export class Pipeline implements ProtoSerializable This stage allows you to order the results of your pipeline. You can specify multiple {@link
- * Ordering} instances to sort by multiple fields in ascending or descending order. If documents
+ * @firebase/firestore/pipelines#Ordering} instances to sort by multiple fields in ascending or descending order. If documents
* have the same value for a field used for sorting, the next specified ordering will be used. If
* all orderings result in equal comparison, the documents are considered equal and the order is
* unspecified.
*
* Example:
*
+ * @example
* ```typescript
* // Sort books by rating in descending order, and then by title in ascending order for books
* // with the same rating
@@ -936,23 +954,24 @@ export class Pipeline implements ProtoSerializable This stage allows you to order the results of your pipeline. You can specify multiple {@link
- * Ordering} instances to sort by multiple fields in ascending or descending order. If documents
+ * @firebase/firestore/pipelines#Ordering} instances to sort by multiple fields in ascending or descending order. If documents
* have the same value for a field used for sorting, the next specified ordering will be used. If
* all orderings result in equal comparison, the documents are considered equal and the order is
* unspecified.
*
* Example:
*
+ * @example
* ```typescript
* // Sort books by rating in descending order, and then by title in ascending order for books
* // with the same rating
@@ -964,7 +983,7 @@ export class Pipeline implements ProtoSerializable Example:
*
+ * @example
* ```typescript
* // Input.
* // {
@@ -1021,8 +1041,8 @@ export class Pipeline implements ProtoSerializable Example:
*
+ * @example
* ```typescript
* // Input.
* // {
@@ -1059,8 +1080,8 @@ export class Pipeline implements ProtoSerializable Example:
*
+ * @example
* ```typescript
* // Input.
* // {
@@ -1098,7 +1120,7 @@ export class Pipeline implements ProtoSerializable Examples:
*
+ * @example
* ```typescript
* // Sample 25 books, if available.
* firestore.pipeline().collection('books')
* .sample(25);
* ```
*
- * @param documents The number of documents to sample.
- * @return A new {@code Pipeline} object with this stage appended to the stage list.
+ * @param documents - The number of documents to sample.
+ * @returns A new {@link @firebase/firestore/pipelines#Pipeline} object with this stage appended to the stage list.
*/
sample(documents: number): Pipeline;
@@ -1155,10 +1178,10 @@ export class Pipeline implements ProtoSerializable This stage will filter documents pseudo-randomly. The 'options' parameter specifies how
- * sampling will be performed. See {@code SampleOptions} for more information.
- *
- * Examples:
+ * sampling will be performed. See {@link @firebase/firestore/pipelines#SampleStageOptions} for more information.
*
+ * @example
+ * ```typescript
* // Sample 10 books, if available.
* firestore.pipeline().collection("books")
* .sample({ documents: 10 });
@@ -1166,9 +1189,10 @@ export class Pipeline implements ProtoSerializable This stage will pass through documents from previous stage, and also pass through documents
- * from previous stage of the `other` {@code Pipeline} given in parameter. The order of documents
+ * from previous stage of the `other` {@link @firebase/firestore/pipelines#Pipeline} given in parameter. The order of documents
* emitted from this stage is undefined.
*
* Example:
*
+ * @example
* ```typescript
* // Emit documents from books collection and magazines collection.
* firestore.pipeline().collection('books')
* .union(firestore.pipeline().collection('magazines'));
* ```
*
- * @param other The other {@code Pipeline} that is part of union.
- * @return A new {@code Pipeline} object with this stage appended to the stage list.
+ * @param other - The other {@link @firebase/firestore/pipelines#Pipeline} that is part of union.
+ * @returns A new {@link @firebase/firestore/pipelines#Pipeline} object with this stage appended to the stage list.
*/
union(other: Pipeline): Pipeline;
/**
@@ -1227,11 +1252,12 @@ export class Pipeline implements ProtoSerializable This stage will pass through documents from previous stage, and also pass through documents
- * from previous stage of the `other` {@code Pipeline} given in parameter. The order of documents
+ * from previous stage of the `other` {@link @firebase/firestore/pipelines#Pipeline} given in parameter. The order of documents
* emitted from this stage is undefined.
*
* Example:
*
+ * @example
* ```typescript
* // Emit documents from books collection and magazines collection.
* firestore.pipeline().collection('books')
@@ -1239,7 +1265,7 @@ export class Pipeline implements ProtoSerializable Example (Assuming there is no 'where' stage available in SDK):
*
+ * @example
* ```typescript
* // Assume we don't have a built-in 'where' stage
* firestore.pipeline().collection('books')
@@ -1397,7 +1426,7 @@ export class Pipeline implements ProtoSerializable Example:
- *
+ * @example
* ```typescript
* const snapshot: PipelineSnapshot = await execute(firestore.pipeline().collection("books")
* .where(gt(field("rating"), 4.5))
@@ -82,8 +81,8 @@ declare module './database' {
* const results: PipelineResults = snapshot.results;
* ```
*
- * @param pipeline The pipeline to execute.
- * @return A Promise representing the asynchronous pipeline execution.
+ * @param pipeline - The pipeline to execute.
+ * @returns A Promise representing the asynchronous pipeline execution.
*/
export function execute(pipeline: Pipeline): Promiseref will return a undefined value. |
+| [PipelineSnapshot](./firestore_lite_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) | (Public Preview) Represents the results of a Firestore pipeline execution.A PipelineSnapshot contains zero or more [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) objects representing the documents returned by a pipeline query. It provides methods to iterate over the documents and access metadata about the query results. |
+| [PipelineSource](./firestore_lite_pipelines.pipelinesource.md#pipelinesource_class) | (Public Preview) Provides the entry point for defining the data source of a Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).Use the methods of this class (e.g., [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection), [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup), [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase), or [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments)) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents. |
| [Query](./firestore_lite_pipelines.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. |
| [QueryDocumentSnapshot](./firestore_lite_pipelines.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. |
| [Timestamp](./firestore_lite_pipelines.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). |
-| [VectorValue](./firestore_lite_pipelines.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue |
+| [VectorValue](./firestore_lite_pipelines.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). |
## Interfaces
@@ -1784,30 +351,30 @@ const results3 = await execute(db.pipeline()
| Type Alias | Description |
| --- | --- |
-| [AddFieldsStageOptions](./firestore_lite_pipelines.md#addfieldsstageoptions) | (Public Preview) Options defining how an AddFieldsStage is evaluated. See . |
-| [AggregateStageOptions](./firestore_lite_pipelines.md#aggregatestageoptions) | (Public Preview) Options defining how an AggregateStage is evaluated. See . |
-| [CollectionGroupStageOptions](./firestore_lite_pipelines.md#collectiongroupstageoptions) | (Public Preview) Defines the configuration options for a within a pipeline. This type extends and provides specific settings for how a collection group is identified and processed during pipeline execution. |
-| [CollectionStageOptions](./firestore_lite_pipelines.md#collectionstageoptions) | (Public Preview) Options defining how a CollectionStage is evaluated. See . |
-| [DatabaseStageOptions](./firestore_lite_pipelines.md#databasestageoptions) | (Public Preview) Options defining how a DatabaseStage is evaluated. See . |
-| [DistinctStageOptions](./firestore_lite_pipelines.md#distinctstageoptions) | (Public Preview) Options defining how a DistinctStage is evaluated. See . |
-| [DocumentsStageOptions](./firestore_lite_pipelines.md#documentsstageoptions) | (Public Preview) Options defining how a DocumentsStage is evaluated. See . |
+| [AddFieldsStageOptions](./firestore_lite_pipelines.md#addfieldsstageoptions) | (Public Preview) Options defining how an AddFieldsStage is evaluated. See [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields). |
+| [AggregateStageOptions](./firestore_lite_pipelines.md#aggregatestageoptions) | (Public Preview) Options defining how an AggregateStage is evaluated. See [Pipeline.aggregate()](./firestore_pipelines.pipeline.md#pipelineaggregate). |
+| [CollectionGroupStageOptions](./firestore_lite_pipelines.md#collectiongroupstageoptions) | (Public Preview) Defines the configuration options for a CollectionGroupStage within a pipeline. This type extends [StageOptions](./firestore_pipelines.stageoptions.md#stageoptions_interface) and provides specific settings for how a collection group is identified and processed during pipeline execution.See [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup) to create a collection group stage. |
+| [CollectionStageOptions](./firestore_lite_pipelines.md#collectionstageoptions) | (Public Preview) Options defining how a CollectionStage is evaluated. See [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection). |
+| [DatabaseStageOptions](./firestore_lite_pipelines.md#databasestageoptions) | (Public Preview) Options defining how a DatabaseStage is evaluated. See [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase). |
+| [DistinctStageOptions](./firestore_lite_pipelines.md#distinctstageoptions) | (Public Preview) Options defining how a DistinctStage is evaluated. See [Pipeline.distinct()](./firestore_pipelines.pipeline.md#pipelinedistinct). |
+| [DocumentsStageOptions](./firestore_lite_pipelines.md#documentsstageoptions) | (Public Preview) Options defining how a DocumentsStage is evaluated. See [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments). |
| [ExpressionType](./firestore_lite_pipelines.md#expressiontype) | (Public Preview) An enumeration of the different types of expressions. |
-| [FindNearestStageOptions](./firestore_lite_pipelines.md#findneareststageoptions) | (Public Preview) Options defining how a FindNearestStage is evaluated. See . |
-| [LimitStageOptions](./firestore_lite_pipelines.md#limitstageoptions) | (Public Preview) Options defining how a LimitStage is evaluated. See . |
-| [OffsetStageOptions](./firestore_lite_pipelines.md#offsetstageoptions) | (Public Preview) Options defining how an OffsetStage is evaluated. See . |
-| [OneOf](./firestore_lite_pipelines.md#oneof) | (Public Preview) Utility type to create an type that only allows one property of the Type param T to be set.type XorY = OneOf<{ x: unknown, y: unknown}> let a = { x: "foo" } // OK let b = { y: "foo" } // OK let c = { a: "foo", y: "foo" } // Not OK |
+| [FindNearestStageOptions](./firestore_lite_pipelines.md#findneareststageoptions) | (Public Preview) Options defining how a FindNearestStage is evaluated. See [Pipeline.findNearest()](./firestore_pipelines.pipeline.md#pipelinefindnearest). |
+| [LimitStageOptions](./firestore_lite_pipelines.md#limitstageoptions) | (Public Preview) Options defining how a LimitStage is evaluated. See [Pipeline.limit()](./firestore_pipelines.pipeline.md#pipelinelimit). |
+| [OffsetStageOptions](./firestore_lite_pipelines.md#offsetstageoptions) | (Public Preview) Options defining how an OffsetStage is evaluated. See [Pipeline.offset()](./firestore_pipelines.pipeline.md#pipelineoffset). |
+| [OneOf](./firestore_lite_pipelines.md#oneof) | (Public Preview) Utility type to create an type that only allows one property of the Type param T to be set. |
| [PartialWithFieldValue](./firestore_lite_pipelines.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. |
| [Primitive](./firestore_lite_pipelines.md#primitive) | Primitive types. |
-| [RemoveFieldsStageOptions](./firestore_lite_pipelines.md#removefieldsstageoptions) | (Public Preview) Options defining how a RemoveFieldsStage is evaluated. See . |
-| [ReplaceWithStageOptions](./firestore_lite_pipelines.md#replacewithstageoptions) | (Public Preview) Options defining how a ReplaceWithStage is evaluated. See . |
-| [SampleStageOptions](./firestore_lite_pipelines.md#samplestageoptions) | (Public Preview) Defines the options for evaluating a sample stage within a pipeline. This type combines common with a specific configuration where only one of the defined sampling methods can be applied.See to create a sample stage.. |
-| [SelectStageOptions](./firestore_lite_pipelines.md#selectstageoptions) | (Public Preview) Options defining how a SelectStage is evaluated. See . |
+| [RemoveFieldsStageOptions](./firestore_lite_pipelines.md#removefieldsstageoptions) | (Public Preview) Options defining how a RemoveFieldsStage is evaluated. See [Pipeline.removeFields()](./firestore_pipelines.pipeline.md#pipelineremovefields). |
+| [ReplaceWithStageOptions](./firestore_lite_pipelines.md#replacewithstageoptions) | (Public Preview) Options defining how a ReplaceWithStage is evaluated. See [Pipeline.replaceWith()](./firestore_pipelines.pipeline.md#pipelinereplacewith). |
+| [SampleStageOptions](./firestore_lite_pipelines.md#samplestageoptions) | (Public Preview) Defines the options for evaluating a sample stage within a pipeline. This type combines common [StageOptions](./firestore_pipelines.stageoptions.md#stageoptions_interface) with a specific configuration where only one of the defined sampling methods can be applied.See [Pipeline.sample()](./firestore_pipelines.pipeline.md#pipelinesample) to create a sample stage.. |
+| [SelectStageOptions](./firestore_lite_pipelines.md#selectstageoptions) | (Public Preview) Options defining how a SelectStage is evaluated. See [Pipeline.select()](./firestore_pipelines.pipeline.md#pipelineselect). |
| [SetOptions](./firestore_lite_pipelines.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. |
-| [SortStageOptions](./firestore_lite_pipelines.md#sortstageoptions) | (Public Preview) Options defining how a SortStage is evaluated. See . |
+| [SortStageOptions](./firestore_lite_pipelines.md#sortstageoptions) | (Public Preview) Options defining how a SortStage is evaluated. See [Pipeline.sort()](./firestore_pipelines.pipeline.md#pipelinesort). |
| [TimeGranularity](./firestore_lite_pipelines.md#timegranularity) | (Public Preview) Specify time granularity for expressions. |
-| [UnionStageOptions](./firestore_lite_pipelines.md#unionstageoptions) | (Public Preview) Options defining how a UnionStage is evaluated. See . |
+| [UnionStageOptions](./firestore_lite_pipelines.md#unionstageoptions) | (Public Preview) Options defining how a UnionStage is evaluated. See [Pipeline.union()](./firestore_pipelines.pipeline.md#pipelineunion). |
| [UnnestStageOptions](./firestore_lite_pipelines.md#unneststageoptions) | (Public Preview) Represents the specific options available for configuring an UnnestStage within a pipeline. |
-| [WhereStageOptions](./firestore_lite_pipelines.md#wherestageoptions) | (Public Preview) Options defining how a WhereStage is evaluated. See . |
+| [WhereStageOptions](./firestore_lite_pipelines.md#wherestageoptions) | (Public Preview) Options defining how a WhereStage is evaluated. See [Pipeline.where()](./firestore_pipelines.pipeline.md#pipelinewhere). |
| [WithFieldValue](./firestore_lite_pipelines.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. |
## function()
@@ -1819,13 +386,6 @@ const results3 = await execute(db.pipeline()
Creates an aggregation that counts the total number of stage inputs.
-```typescript
-// Count the total number of input documents
-countAll().as("totalDocument");
-
-```
- A new representing the 'countAll' aggregation.
-
Signature:
```typescript
@@ -1835,19 +395,23 @@ export declare function countAll(): AggregateFunction;
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### currentTimestamp() {:#currenttimestamp}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'countAll' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that evaluates to the current server timestamp.
```typescript
-// Get the current server timestamp
-currentTimestamp()
+// Count the total number of input documents
+countAll().as("totalDocument");
```
- A new Expression representing the current server timestamp.
+
+### currentTimestamp() {:#currenttimestamp}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that evaluates to the current server timestamp.
Signature:
@@ -1858,6 +422,17 @@ export declare function currentTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new Expression representing the current server timestamp.
+
+### Example
+
+
+```typescript
+// Get the current server timestamp
+currentTimestamp()
+
+```
+
## function(array, ...)
### arrayContains(array, element) {:#arraycontains_a00ea48}
@@ -1867,12 +442,6 @@ export declare function currentTimestamp(): FunctionExpression;
Creates an expression that checks if an array expression contains a specific element.
-```typescript
-// Check if the 'colors' array contains the value of field 'selectedColor'
-arrayContains(field("colors"), field("selectedColor"));
-
-```
-
Signature:
```typescript
@@ -1884,25 +453,30 @@ export declare function arrayContains(array: Expression, element: Expression): B
| Parameter | Type | Description |
| --- | --- | --- |
| array | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The array expression to check. |
-| element | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. |
+| element | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContains(array, element) {:#arraycontains_7328608}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array expression contains a specific element.
```typescript
-// Check if the 'colors' array contains "red"
-arrayContains(field("colors"), "red");
+// Check if the 'colors' array contains the value of field 'selectedColor'
+arrayContains(field("colors"), field("selectedColor"));
```
+### arrayContains(array, element) {:#arraycontains_7328608}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array expression contains a specific element.
+
Signature:
```typescript
@@ -1914,25 +488,30 @@ export declare function arrayContains(array: Expression, element: unknown): Bool
| Parameter | Type | Description |
| --- | --- | --- |
| array | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The array expression to check. |
-| element | unknown | The element to search for in the array. A new representing the 'array\_contains' comparison. |
+| element | unknown | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContainsAll(array, values) {:#arraycontainsall_c658ad5}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array expression contains all the specified elements.
```typescript
-// Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1"
-arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]);
+// Check if the 'colors' array contains "red"
+arrayContains(field("colors"), "red");
```
+### arrayContainsAll(array, values) {:#arraycontainsall_c658ad5}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array expression contains all the specified elements.
+
Signature:
```typescript
@@ -1944,18 +523,16 @@ export declare function arrayContainsAll(array: Expression, values: ArrayExpression evaluating to an array. |
+| offset | number | The index of the element to return. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### arrayGet(arrayExpression, offsetExpr) {:#arrayget_484550d}
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet(field('tags'), field('favoriteTag'));
+// Return the value in the tags field array at index 1.
+arrayGet(field('tags'), 1);
```
+### arrayGet(arrayExpression, offsetExpr) {:#arrayget_484550d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
@@ -2125,26 +733,32 @@ export declare function arrayGet(arrayExpression: Expression, offsetExpr: Expres
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expr evaluating to an array. |
-| offsetExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expr evaluating to the index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expression evaluating to an array. |
+| offsetExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expression evaluating to the index of the element to return. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### join(arrayExpression, delimiterExpression) {:#join_313e6aa}
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join an array of string using the delimiter from the 'separator' field.
-join(array(['foo', 'bar']), field("separator"))
+// Return the value in the tags field array at index specified by field
+// 'favoriteTag'.
+arrayGet(field('tags'), field('favoriteTag'));
```
+### join(arrayExpression, delimiterExpression) {:#join_313e6aa}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2156,25 +770,30 @@ export declare function join(arrayExpression: Expression, delimiterExpression: E
| Parameter | Type | Description |
| --- | --- | --- |
| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression that evaluates to an array. |
-| delimiterExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. A new Expression representing the join operation. |
+| delimiterExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
-### join(arrayExpression, delimiter) {:#join_d088d29}
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join(field("tags"), ", ")
+// Join an array of string using the delimiter from the 'separator' field.
+join(array(['foo', 'bar']), field("separator"))
```
+### join(arrayExpression, delimiter) {:#join_d088d29}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2186,12 +805,23 @@ export declare function join(arrayExpression: Expression, delimiter: string): Ex
| Parameter | Type | Description |
| --- | --- | --- |
| arrayExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression that evaluates to an array. |
-| delimiter | string | The string to use as a delimiter. A new Expression representing the join operation. |
+| delimiter | string | The string to use as a delimiter. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new Expression representing the join operation.
+
+### Example
+
+
+```typescript
+// Join the elements of the 'tags' field with a comma and space.
+join(field("tags"), ", ")
+
+```
+
## function(arrayField, ...)
### arrayGet(arrayField, offset) {:#arrayget_3f58471}
@@ -2201,12 +831,6 @@ export declare function join(arrayExpression: Expression, delimiter: string): Ex
Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index 1.
-arrayGet('tags', 1);
-
-```
-
Signature:
```typescript
@@ -2218,26 +842,30 @@ export declare function arrayGet(arrayField: string, offset: number): FunctionEx
| Parameter | Type | Description |
| --- | --- | --- |
| arrayField | string | The name of the array field. |
-| offset | number | The index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| offset | number | The index of the element to return. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### arrayGet(arrayField, offsetExpr) {:#arrayget_1904c9a}
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet('tags', field('favoriteTag'));
+// Return the value in the tags field array at index 1.
+arrayGet('tags', 1);
```
+### arrayGet(arrayField, offsetExpr) {:#arrayget_1904c9a}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
@@ -2249,12 +877,24 @@ export declare function arrayGet(arrayField: string, offsetExpr: Expression): Fu
| Parameter | Type | Description |
| --- | --- | --- |
| arrayField | string | The name of the array field. |
-| offsetExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expr evaluating to the index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| offsetExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An Expression evaluating to the index of the element to return. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the 'arrayGet' operation.
+
+### Example
+
+
+```typescript
+// Return the value in the tags field array at index specified by field
+// 'favoriteTag'.
+arrayGet('tags', field('favoriteTag'));
+
+```
+
## function(arrayFieldName, ...)
### join(arrayFieldName, delimiter) {:#join_478ef36}
@@ -2264,12 +904,6 @@ export declare function arrayGet(arrayField: string, offsetExpr: Expression): Fu
Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join("tags", ", ")
-
-```
-
Signature:
```typescript
@@ -2281,25 +915,30 @@ export declare function join(arrayFieldName: string, delimiter: string): Express
| Parameter | Type | Description |
| --- | --- | --- |
| arrayFieldName | string | The name of the field containing the array. |
-| delimiter | string | The string to use as a delimiter. A new Expression representing the join operation. |
+| delimiter | string | The string to use as a delimiter. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
-### join(arrayFieldName, delimiterExpression) {:#join_829294c}
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-join('tags', field("separator"))
+// Join the elements of the 'tags' field with a comma and space.
+join("tags", ", ")
```
+### join(arrayFieldName, delimiterExpression) {:#join_829294c}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2311,12 +950,23 @@ export declare function join(arrayFieldName: string, delimiterExpression: Expres
| Parameter | Type | Description |
| --- | --- | --- |
| arrayFieldName | string | The name of the field containing the array. |
-| delimiterExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. A new Expression representing the join operation. |
+| delimiterExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new Expression representing the join operation.
+
+### Example
+
+
+```typescript
+// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
+join('tags', field("separator"))
+
+```
+
## function(base, ...)
### pow(base, exponent) {:#pow_e4a9e64}
@@ -2326,12 +976,6 @@ export declare function join(arrayFieldName: string, delimiterExpression: Expres
Creates an expression that returns the value of the base expression raised to the power of the exponent expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow(field("base"), field("exponent"));
-
-```
-
Signature:
```typescript
@@ -2343,25 +987,30 @@ export declare function pow(base: Expression, exponent: Expression): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| base | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise to the power of the exponent. |
-| exponent | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### pow(base, exponent) {:#pow_93eae7f}
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of the base expression raised to the power of the exponent.
```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow(field("base"), 2);
+// Raise the value of the 'base' field to the power of the 'exponent' field.
+pow(field("base"), field("exponent"));
```
+### pow(base, exponent) {:#pow_93eae7f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of the base expression raised to the power of the exponent.
+
Signature:
```typescript
@@ -2373,25 +1022,30 @@ export declare function pow(base: Expression, exponent: number): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
| base | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise to the power of the exponent. |
-| exponent | number | The constant value to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | number | The constant value to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### pow(base, exponent) {:#pow_a237721}
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of the base field raised to the power of the exponent expression.
```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow("base", field("exponent"));
+// Raise the value of the 'base' field to the power of 2.
+pow(field("base"), 2);
```
+### pow(base, exponent) {:#pow_a237721}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of the base field raised to the power of the exponent expression.
+
Signature:
```typescript
@@ -2403,25 +1057,30 @@ export declare function pow(base: string, exponent: Expression): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
| base | string | The name of the field to raise to the power of the exponent. |
-| exponent | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### pow(base, exponent) {:#pow_f4d7908}
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of the base field raised to the power of the exponent.
```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow("base", 2);
+// Raise the value of the 'base' field to the power of the 'exponent' field.
+pow("base", field("exponent"));
```
+### pow(base, exponent) {:#pow_f4d7908}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of the base field raised to the power of the exponent.
+
Signature:
```typescript
@@ -2433,12 +1092,23 @@ export declare function pow(base: string, exponent: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| base | string | The name of the field to raise to the power of the exponent. |
-| exponent | number | The constant value to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | number | The constant value to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the power operation.
+
+### Example
+
+
+```typescript
+// Raise the value of the 'base' field to the power of 2.
+pow("base", 2);
+
+```
+
## function(booleanExpr, ...)
### countIf(booleanExpr) {:#countif_c5b8fb1}
@@ -2448,12 +1118,6 @@ export declare function pow(base: string, exponent: number): FunctionExpression;
Creates an aggregation that counts the number of stage inputs where the provided boolean expression evaluates to true.
-```typescript
-// Count the number of documents where 'is_active' field equals true
-countIf(field("is_active").equal(true)).as("numActiveDocuments");
-
-```
-
Signature:
```typescript
@@ -2472,6 +1136,15 @@ export declare function countIf(booleanExpr: BooleanExpression): AggregateFuncti
A new `AggregateFunction` representing the 'countIf' aggregation.
+### Example
+
+
+```typescript
+// Count the number of documents where 'is_active' field equals true
+countIf(field("is_active").equal(true)).as("numActiveDocuments");
+
+```
+
### not(booleanExpr) {:#not_c5b8fb1}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2479,12 +1152,6 @@ A new `AggregateFunction` representing the 'countIf' aggregation.
Creates an expression that negates a filter condition.
-```typescript
-// Find documents where the 'completed' field is NOT true
-not(equal("completed", true));
-
-```
-
Signature:
```typescript
@@ -2495,12 +1162,23 @@ export declare function not(booleanExpr: BooleanExpression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| booleanExpr | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The filter condition to negate. A new representing the negated filter condition. |
+| booleanExpr | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The filter condition to negate. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the negated filter condition.
+
+### Example
+
+
+```typescript
+// Find documents where the 'completed' field is NOT true
+not(equal("completed", true));
+
+```
+
## function(condition, ...)
### conditional(condition, thenExpr, elseExpr) {:#conditional_07a206d}
@@ -2510,13 +1188,6 @@ export declare function not(booleanExpr: BooleanExpression): BooleanExpression;
Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-conditional(
- greaterThan("age", 18), constant("Adult"), constant("Minor"));
-
-```
-
Signature:
```typescript
@@ -2529,12 +1200,24 @@ export declare function conditional(condition: BooleanExpression, thenExpr: Expr
| --- | --- | --- |
| condition | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The condition to evaluate. |
| thenExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is true. |
-| elseExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. |
+| elseExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the conditional expression.
+
+### Example
+
+
+```typescript
+// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
+conditional(
+ greaterThan("age", 18), constant("Adult"), constant("Minor"));
+
+```
+
## function(documentPath, ...)
### documentId(documentPath) {:#documentid_cef293c}
@@ -2544,13 +1227,6 @@ export declare function conditional(condition: BooleanExpression, thenExpr: Expr
Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(myDocumentReference);
-
-```
- A new representing the documentId operation.
-
Signature:
```typescript
@@ -2567,6 +1243,17 @@ export declare function documentId(documentPath: string | DocumentReference): Fu
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the documentId operation.
+
+### Example
+
+
+```typescript
+// Get the document ID from a path.
+documentId(myDocumentReference);
+
+```
+
## function(documentPathExpr, ...)
### documentId(documentPathExpr) {:#documentid_9a69021}
@@ -2576,13 +1263,6 @@ export declare function documentId(documentPath: string | DocumentReference): Fu
Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(field("__path__"));
-
-```
- A new representing the documentId operation.
-
Signature:
```typescript
@@ -2599,6 +1279,17 @@ export declare function documentId(documentPathExpr: Expression): FunctionExpres
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the documentId operation.
+
+### Example
+
+
+```typescript
+// Get the document ID from a path.
+documentId(field("__path__"));
+
+```
+
## function(element, ...)
### notEqualAny(element, values) {:#notequalany_c2c5bcb}
@@ -2608,12 +1299,6 @@ export declare function documentId(documentPathExpr: Expression): FunctionExpres
Creates an expression that checks if an expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny(field("status"), ["pending", field("rejectedStatus")]);
-
-```
-
Signature:
```typescript
@@ -2625,25 +1310,30 @@ export declare function notEqualAny(element: Expression, values: ArrayOrdering for ascending sorting. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to create an ascending ordering for. |
Returns:
[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
-### byteLength(expr) {:#bytelength_005f3d4}
+A new `Ordering` for ascending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob.
```typescript
-// Calculate the length of the 'myString' field in bytes.
-byteLength(field("myString"));
+// Sort documents by the 'name' field in lowercase in ascending order
+firestore.pipeline().collection("users")
+ .sort(ascending(field("name").toLower()));
```
+### byteLength(expr) {:#bytelength_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob.
+
Signature:
```typescript
@@ -2799,12 +1511,23 @@ export declare function byteLength(expr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the string. A new representing the length of the string in bytes. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the string. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string in bytes.
+
+### Example
+
+
+```typescript
+// Calculate the length of the 'myString' field in bytes.
+byteLength(field("myString"));
+
+```
+
### countDistinct(expr) {:#countdistinct_3c28b08}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2822,25 +1545,20 @@ export declare function countDistinct(expr: Expression | string): AggregateFunct
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| string | The expression or field to count distinct values of. A new AggregateFunction representing the 'count\_distinct' aggregation. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| string | The expression or field to count distinct values of. |
Returns:
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+A new `AggregateFunction` representing the 'count\_distinct' aggregation.
+
### descending(expr) {:#descending_005f3d4}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an that sorts documents in descending order based on an expression.
-
-```typescript
-// Sort documents by the 'name' field in lowercase in descending order
-firestore.pipeline().collection("users")
- .sort(descending(field("name").toLower()));
-
-```
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on an expression.
Signature:
@@ -2852,12 +1570,24 @@ export declare function descending(expr: Expression): Ordering;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to create a descending ordering for. A new Ordering for descending sorting. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to create a descending ordering for. |
Returns:
[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
+A new `Ordering` for descending sorting.
+
+### Example
+
+
+```typescript
+// Sort documents by the 'name' field in lowercase in descending order
+firestore.pipeline().collection("users")
+ .sort(descending(field("name").toLower()));
+
+```
+
### floor(expr) {:#floor_005f3d4}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2875,12 +1605,14 @@ export declare function floor(expr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compute the floor of. A new representing the floor of the numeric value. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compute the floor of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the floor of the numeric value.
+
### timestampToUnixMicros(expr) {:#timestamptounixmicros_005f3d4}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2888,34 +1620,60 @@ export declare function floor(expr: Expression): FunctionExpression;
Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+Signature:
+
+```typescript
+export declare function timestampToUnixMicros(expr: Expression): FunctionExpression;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the timestamp. |
+
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of microseconds since epoch.
+
+### Example
+
+
```typescript
// Convert the 'timestamp' field to microseconds since epoch.
timestampToUnixMicros(field("timestamp"));
```
+### timestampToUnixMillis(expr) {:#timestamptounixmillis_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
-export declare function timestampToUnixMicros(expr: Expression): FunctionExpression;
+export declare function timestampToUnixMillis(expr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the timestamp. A new representing the number of microseconds since epoch. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the timestamp. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixMillis(expr) {:#timestamptounixmillis_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of milliseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
// Convert the 'timestamp' field to milliseconds since epoch.
@@ -2923,28 +1681,33 @@ timestampToUnixMillis(field("timestamp"));
```
+### timestampToUnixSeconds(expr) {:#timestamptounixseconds_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
-export declare function timestampToUnixMillis(expr: Expression): FunctionExpression;
+export declare function timestampToUnixSeconds(expr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the timestamp. A new representing the number of milliseconds since epoch. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the timestamp. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixSeconds(expr) {:#timestamptounixseconds_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of seconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
// Convert the 'timestamp' field to seconds since epoch.
@@ -2952,28 +1715,33 @@ timestampToUnixSeconds(field("timestamp"));
```
+### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
-export declare function timestampToUnixSeconds(expr: Expression): FunctionExpression;
+export declare function unixMicrosToTimestamp(expr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the timestamp. A new representing the number of seconds since epoch. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the number of microseconds since epoch. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
// Interpret the 'microseconds' field as microseconds since epoch.
@@ -2981,28 +1749,33 @@ unixMicrosToTimestamp(field("microseconds"));
```
+### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
-export declare function unixMicrosToTimestamp(expr: Expression): FunctionExpression;
+export declare function unixMillisToTimestamp(expr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the number of microseconds since epoch. A new representing the timestamp. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the number of milliseconds since epoch. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
// Interpret the 'milliseconds' field as milliseconds since epoch.
@@ -3010,28 +1783,33 @@ unixMillisToTimestamp(field("milliseconds"));
```
+### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
-export declare function unixMillisToTimestamp(expr: Expression): FunctionExpression;
+export declare function unixSecondsToTimestamp(expr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the number of milliseconds since epoch. A new representing the timestamp. |
+| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the number of seconds since epoch. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
// Interpret the 'seconds' field as seconds since epoch.
@@ -3039,30 +1817,35 @@ unixSecondsToTimestamp(field("seconds"));
```
+## function(expression, ...)
+
+### arraySum(expression) {:#arraysum_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the sum of the elements in an array.
+
Signature:
```typescript
-export declare function unixSecondsToTimestamp(expr: Expression): FunctionExpression;
+export declare function arraySum(expression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the number of seconds since epoch. A new representing the timestamp. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric array, which the sum will be computed for. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-## function(expression, ...)
-
-### arraySum(expression) {:#arraysum_1138a27}
+A new `Expression` representing the sum of the elements in the array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the sum of the elements in an array.
```typescript
// Compute the sum of the elements in the 'scores' field.
@@ -3070,28 +1853,33 @@ arraySum(field("scores"));
```
+### average(expression) {:#average_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs.
+
Signature:
```typescript
-export declare function arraySum(expression: Expression): FunctionExpression;
+export declare function average(expression: Expression): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric array, which the sum will be computed for. A new Expr representing the sum of the elements in the array. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the values to average. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### average(expression) {:#average_1138a27}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'average' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs.
```typescript
// Calculate the average age of users
@@ -3099,28 +1887,33 @@ average(field("age")).as("averageAge");
```
+### ceil(expression) {:#ceil_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the ceiling of a numeric value.
+
Signature:
```typescript
-export declare function average(expression: Expression): AggregateFunction;
+export declare function ceil(expression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the values to average. A new representing the 'average' aggregation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the ceiling will be computed for. |
Returns:
-[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### ceil(expression) {:#ceil_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the ceiling of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the ceiling of a numeric value.
```typescript
// Compute the ceiling of the 'price' field.
@@ -3128,28 +1921,33 @@ ceil(field("price"));
```
+### collectionId(expression) {:#collectionid_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the collection ID from a path.
+
Signature:
```typescript
-export declare function ceil(expression: Expression): FunctionExpression;
+export declare function collectionId(expression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the ceiling will be computed for. A new representing the ceiling of the numeric value. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a path, which the collection ID will be extracted from. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### collectionId(expression) {:#collectionid_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the collectionId operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the collection ID from a path.
```typescript
// Get the collection ID from a path.
@@ -3157,28 +1955,33 @@ collectionId(field("__name__"));
```
+### count(expression) {:#count_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression.
+
Signature:
```typescript
-export declare function collectionId(expression: Expression): FunctionExpression;
+export declare function count(expression: Expression): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a path, which the collection ID will be extracted from. A new representing the collectionId operation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to count. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### count(expression) {:#count_1138a27}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'count' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression.
```typescript
// Count the number of items where the price is greater than 10
@@ -3186,28 +1989,34 @@ count(field("price").greaterThan(10)).as("expensiveItemCount");
```
+### divide(expression, value) {:#divide_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides an expression by a constant value.
+
Signature:
```typescript
-export declare function count(expression: Expression): AggregateFunction;
+export declare function divide(expression: Expression, value: unknown): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to count. A new representing the 'count' aggregation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to be divided. |
+| value | unknown | The constant value to divide by. |
Returns:
-[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### divide(expression, value) {:#divide_01df3cf}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides an expression by a constant value.
```typescript
// Divide the 'value' field by 10
@@ -3215,29 +2024,34 @@ divide(field("value"), 10);
```
+### equal(expression, value) {:#equal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is equal to a constant value.
+
Signature:
```typescript
-export declare function divide(expression: Expression, value: unknown): FunctionExpression;
+export declare function equal(expression: Expression, value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to be divided. |
-| value | unknown | The constant value to divide by. A new representing the division operation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare. |
+| value | unknown | The constant value to compare to. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### equal(expression, value) {:#equal_01df3cf}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is equal to a constant value.
```typescript
// Check if the 'age' field is equal to 21
@@ -3245,29 +2059,34 @@ equal(field("age"), 21);
```
+### equalAny(expression, values) {:#equalany_7e759b5}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions.
+
Signature:
```typescript
-export declare function equal(expression: Expression, value: unknown): BooleanExpression;
+export declare function equalAny(expression: Expression, values: ArrayExpr representing the equality comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression whose results to compare. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The values to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### equalAny(expression, values) {:#equalany_7e759b5}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -3275,10 +2094,17 @@ equalAny(field("category"), [constant("Electronics"), field("primaryType")]);
```
+### equalAny(expression, arrayExpression) {:#equalany_214ce68}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is equal to any of the provided values.
+
Signature:
```typescript
-export declare function equalAny(expression: Expression, values: ArrayExpr representing the greater than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(expression, value) {:#greaterthanorequal_01df3cf}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is greater than or equal to a constant value.
```typescript
// Check if the 'quantity' field is greater than or equal to 10
@@ -3395,29 +2233,33 @@ greaterThanOrEqual(field("quantity"), 10);
```
+### length\_2(expression) {:#length_2_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string, array, map, vector, or bytes.
+
Signature:
```typescript
-export declare function greaterThanOrEqual(expression: Expression, value: unknown): BooleanExpression;
+declare function length_2(expression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the greater than or equal to comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a string, array, map, vector, or bytes, which the length will be calculated for. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### length\_2(expression) {:#length_2_1138a27}
+A new `Expression` representing the length of the string, array, map, vector, or bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string, array, map, vector, or bytes.
```typescript
// Get the length of the 'name' field.
@@ -3428,28 +2270,34 @@ length(field("cart"));
```
+### lessThan(expression, value) {:#lessthan_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is less than a constant value.
+
Signature:
```typescript
-declare function length_2(expression: Expression): FunctionExpression;
+export declare function lessThan(expression: Expression, value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a string, array, map, vector, or bytes, which the length will be calculated for. A new Expr representing the length of the string, array, map, vector, or bytes. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare. |
+| value | unknown | The constant value to compare to. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(expression, value) {:#lessthan_01df3cf}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is less than a constant value.
```typescript
// Check if the 'age' field is less than 30
@@ -3457,10 +2305,17 @@ lessThan(field("age"), 30);
```
+### lessThanOrEqual(expression, value) {:#lessthanorequal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is less than or equal to a constant value.
+
Signature:
```typescript
-export declare function lessThan(expression: Expression, value: unknown): BooleanExpression;
+export declare function lessThanOrEqual(expression: Expression, value: unknown): BooleanExpression;
```
#### Parameters
@@ -3468,18 +2323,16 @@ export declare function lessThan(expression: Expression, value: unknown): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(expression, value) {:#lessthanorequal_01df3cf}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is less than or equal to a constant value.
```typescript
// Check if the 'quantity' field is less than or equal to 20
@@ -3487,29 +2340,33 @@ lessThan(field("quantity"), 20);
```
+### ln(expression) {:#ln_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the natural logarithm of a numeric value.
+
Signature:
```typescript
-export declare function lessThanOrEqual(expression: Expression, value: unknown): BooleanExpression;
+export declare function ln(expression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than or equal to comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the natural logarithm will be computed for. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### ln(expression) {:#ln_1138a27}
+A new `Expression` representing the natural logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the natural logarithm of a numeric value.
```typescript
// Compute the natural logarithm of the 'value' field.
@@ -3517,39 +2374,52 @@ ln(field("value"));
```
+### log(expression, base) {:#log_ac183e2}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of an expression to a given base.
+
Signature:
```typescript
-export declare function ln(expression: Expression): FunctionExpression;
+export declare function log(expression: Expression, base: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the natural logarithm will be computed for. A new Expr representing the natural logarithm of the numeric value. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the logarithm will be computed for. |
+| base | number | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### log(expression, base) {:#log_ac183e2}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of an expression to a given base.
```typescript
// Compute the logarithm of the 'value' field with base 10.
log(field("value"), 10);
-```
+```
+
+### log(expression, base) {:#log_1894737}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of an expression to a given base.
Signature:
```typescript
-export declare function log(expression: Expression, base: number): FunctionExpression;
+export declare function log(expression: Expression, base: Expression): FunctionExpression;
```
#### Parameters
@@ -3557,18 +2427,16 @@ export declare function log(expression: Expression, base: number): FunctionExpre
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the logarithm will be computed for. |
-| base | number | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| base | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### log(expression, base) {:#log_1894737}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of an expression to a given base.
```typescript
// Compute the logarithm of the 'value' field with the base in the 'base' field.
@@ -3576,29 +2444,33 @@ log(field("value"), field("base"));
```
+### log10(expression) {:#log10_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the base-10 logarithm of a numeric value.
+
Signature:
```typescript
-export declare function log(expression: Expression, base: Expression): FunctionExpression;
+export declare function log10(expression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the logarithm will be computed for. |
-| base | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the base-10 logarithm will be computed for. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### log10(expression) {:#log10_1138a27}
+A new `Expression` representing the base-10 logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the base-10 logarithm of a numeric value.
```typescript
// Compute the base-10 logarithm of the 'value' field.
@@ -3606,28 +2478,33 @@ log10(field("value"));
```
+### maximum(expression) {:#maximum_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that finds the maximum value of an expression across multiple stage inputs.
+
Signature:
```typescript
-export declare function log10(expression: Expression): FunctionExpression;
+export declare function maximum(expression: Expression): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the base-10 logarithm will be computed for. A new Expr representing the base-10 logarithm of the numeric value. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to find the maximum value of. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### maximum(expression) {:#maximum_1138a27}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'maximum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that finds the maximum value of an expression across multiple stage inputs.
```typescript
// Find the highest score in a leaderboard
@@ -3635,28 +2512,33 @@ maximum(field("score")).as("highestScore");
```
+### minimum(expression) {:#minimum_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that finds the minimum value of an expression across multiple stage inputs.
+
Signature:
```typescript
-export declare function maximum(expression: Expression): AggregateFunction;
+export declare function minimum(expression: Expression): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to find the maximum value of. A new representing the 'maximum' aggregation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to find the minimum value of. |
Returns:
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### minimum(expression) {:#minimum_1138a27}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'minimum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that finds the minimum value of an expression across multiple stage inputs.
```typescript
// Find the lowest price of all products
@@ -3664,22 +2546,6 @@ minimum(field("price")).as("lowestPrice");
```
-Signature:
-
-```typescript
-export declare function minimum(expression: Expression): AggregateFunction;
-```
-
-#### Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to find the minimum value of. A new representing the 'minimum' aggregation. |
-
-Returns:
-
-[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-
### mod(expression, value) {:#mod_01df3cf}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3687,12 +2553,6 @@ export declare function minimum(expression: Expression): AggregateFunction;
Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant.
-```typescript
-// Calculate the remainder of dividing 'field1' by 5.
-mod(field("field1"), 5);
-
-```
-
Signature:
```typescript
@@ -3704,25 +2564,30 @@ export declare function mod(expression: Expression, value: unknown): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The dividend expression. |
-| value | unknown | The divisor constant. A new representing the modulo operation. |
+| value | unknown | The divisor constant. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### notEqual(expression, value) {:#notequal_01df3cf}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the modulo operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is not equal to a constant value.
```typescript
-// Check if the 'status' field is not equal to "completed"
-notEqual(field("status"), "completed");
+// Calculate the remainder of dividing 'field1' by 5.
+mod(field("field1"), 5);
```
+### notEqual(expression, value) {:#notequal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is not equal to a constant value.
+
Signature:
```typescript
@@ -3734,25 +2599,30 @@ export declare function notEqual(expression: Expression, value: unknown): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the inequality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### round(expression) {:#round_1138a27}
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the nearest whole number.
```typescript
-// Round the value of the 'price' field.
-round(field("price"));
+// Check if the 'status' field is not equal to "completed"
+notEqual(field("status"), "completed");
```
+### round(expression) {:#round_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the nearest whole number.
+
Signature:
```typescript
@@ -3763,25 +2633,30 @@ export declare function round(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which will be rounded. A new Expr representing the rounded value. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which will be rounded. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### round(expression, decimalPlaces) {:#round_a3a92d0}
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the specified number of decimal places.
```typescript
-// Round the value of the 'price' field to two decimal places.
-round(field("price"), constant(2));
+// Round the value of the 'price' field.
+round(field("price"));
```
+### round(expression, decimalPlaces) {:#round_a3a92d0}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the specified number of decimal places.
+
Signature:
```typescript
@@ -3793,12 +2668,23 @@ export declare function round(expression: Expression, decimalPlaces: number | Ex
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which will be rounded. |
-| decimalPlaces | number \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | number \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the rounded value.
+
+### Example
+
+
+```typescript
+// Round the value of the 'price' field to two decimal places.
+round(field("price"), constant(2));
+
+```
+
### split(expression, delimiter) {:#split_5b5612b}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3817,12 +2703,14 @@ export declare function split(expression: Expression, delimiter: string): Functi
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Split the result of this expression. |
-| delimiter | string | Split on this delimiter. A new representing the split function. |
+| delimiter | string | Split on this delimiter. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3850,12 +2738,14 @@ export declare function split(expression: Expression, delimiter: Expression): Fu
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Split the result of this expression. |
-| delimiter | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. A new representing the split function. |
+| delimiter | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3872,12 +2762,6 @@ split(field('scores'), conditional(field('format').equal('csv'), constant(','),
Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt(field("value"));
-
-```
-
Signature:
```typescript
@@ -3888,25 +2772,30 @@ export declare function sqrt(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the square root will be computed for. A new representing the square root of the numeric value. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the square root will be computed for. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### subtract(expression, value) {:#subtract_01df3cf}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the square root of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a constant value from an expression.
```typescript
-// Subtract the constant value 2 from the 'value' field
-subtract(field("value"), 2);
+// Compute the square root of the 'value' field.
+sqrt(field("value"));
```
+### subtract(expression, value) {:#subtract_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a constant value from an expression.
+
Signature:
```typescript
@@ -3918,25 +2807,30 @@ export declare function subtract(expression: Expression, value: unknown): Functi
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract from. |
-| value | unknown | The constant value to subtract. A new representing the subtraction operation. |
+| value | unknown | The constant value to subtract. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### sum(expression) {:#sum_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs.
```typescript
-// Calculate the total revenue from a set of orders
-sum(field("orderAmount")).as("totalRevenue");
+// Subtract the constant value 2 from the 'value' field
+subtract(field("value"), 2);
```
+### sum(expression) {:#sum_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs.
+
Signature:
```typescript
@@ -3947,12 +2841,23 @@ export declare function sum(expression: Expression): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to sum up. A new representing the 'sum' aggregation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to sum up. |
Returns:
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'sum' aggregation.
+
+### Example
+
+
+```typescript
+// Calculate the total revenue from a set of orders
+sum(field("orderAmount")).as("totalRevenue");
+
+```
+
### type(expression) {:#type_1138a27}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3976,6 +2881,8 @@ export declare function type(expression: Expression): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the data type.
+
### Example
@@ -3984,7 +2891,6 @@ export declare function type(expression: Expression): FunctionExpression;
type(conditional(exists('foo'), constant(1), constant(true)))
```
- A new {Expression} representing the data type.
## function(field, ...)
@@ -3995,12 +2901,6 @@ type(conditional(exists('foo'), constant(1), constant(true)))
Creates an expression that returns `true` if a field is absent. Otherwise, returns `false` even if the field value is `null`.
-```typescript
-// Check if the field `value` is absent.
-isAbsent("value");
-
-```
-
Signature:
```typescript
@@ -4011,25 +2911,30 @@ export declare function isAbsent(field: string): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| field | string | The field to check. A new representing the 'isAbsent' check. |
+| field | string | The field to check. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### reverse(field) {:#reverse_0fb8cd4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'isAbsent' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses a string value in the specified field.
```typescript
-// Reverse the value of the 'myString' field.
-reverse("myString");
+// Check if the field `value` is absent.
+isAbsent("value");
```
+### reverse(field) {:#reverse_0fb8cd4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses a string value in the specified field.
+
Signature:
```typescript
@@ -4040,25 +2945,30 @@ export declare function reverse(field: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| field | string | The name of the field representing the string to reverse. A new representing the reversed string. |
+| field | string | The name of the field representing the string to reverse. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### stringReverse(field) {:#stringreverse_0fb8cd4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses a string value in the specified field.
```typescript
// Reverse the value of the 'myString' field.
-strReverse("myString");
+reverse("myString");
```
+### stringReverse(field) {:#stringreverse_0fb8cd4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses a string value in the specified field.
+
Signature:
```typescript
@@ -4069,12 +2979,23 @@ export declare function stringReverse(field: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| field | string | The name of the field representing the string to reverse. A new representing the reversed string. |
+| field | string | The name of the field representing the string to reverse. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
+
+### Example
+
+
+```typescript
+// Reverse the value of the 'myString' field.
+strReverse("myString");
+
+```
+
### substring(field, position, length) {:#substring_0d9573a}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -4144,18 +3065,42 @@ export declare function abs(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field to compute the absolute value of. A new representing the absolute value of the numeric value. |
+| fieldName | string | The field to compute the absolute value of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the absolute value of the numeric value.
+
### add(fieldName, second) {:#add_b75bb8b}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an expression that adds a field's value to an expression.
+Creates an expression that adds a field's value to an expression.
+
+Signature:
+
+```typescript
+export declare function add(fieldName: string, second: Expression | unknown): FunctionExpression;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| fieldName | string | The name of the field containing the value to add. |
+| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The second expression or literal to add. |
+
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the addition operation.
+
+### Example
+
```typescript
// Add the value of the 'quantity' field and the 'reserve' field.
@@ -4163,29 +3108,34 @@ add("quantity", field("reserve"));
```
+### arrayContains(fieldName, element) {:#arraycontains_aaace4a}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's array value contains a specific element.
+
Signature:
```typescript
-export declare function add(fieldName: string, second: Expression | unknown): FunctionExpression;
+export declare function arrayContains(fieldName: string, element: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the value to add. |
-| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The second expression or literal to add. |
+| fieldName | string | The field name to check. |
+| element | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The element to search for in the array. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContains(fieldName, element) {:#arraycontains_aaace4a}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's array value contains a specific element.
```typescript
// Check if the 'colors' array contains the value of field 'selectedColor'
@@ -4193,10 +3143,17 @@ arrayContains("colors", field("selectedColor"));
```
+### arrayContains(fieldName, element) {:#arraycontains_999590f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's array value contains a specific value.
+
Signature:
```typescript
-export declare function arrayContains(fieldName: string, element: Expression): BooleanExpression;
+export declare function arrayContains(fieldName: string, element: unknown): BooleanExpression;
```
#### Parameters
@@ -4204,18 +3161,16 @@ export declare function arrayContains(fieldName: string, element: Expression): B
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| element | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. |
+| element | unknown | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContains(fieldName, element) {:#arraycontains_999590f}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's array value contains a specific value.
```typescript
// Check if the 'colors' array contains "red"
@@ -4223,10 +3178,17 @@ arrayContains("colors", "red");
```
+### arrayContainsAll(fieldName, values) {:#arraycontainsall_8060b23}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's array value contains all the specified values or expressions.
+
Signature:
```typescript
-export declare function arrayContains(fieldName: string, element: unknown): BooleanExpression;
+export declare function arrayContainsAll(fieldName: string, values: ArrayExpr representing the sum of the elements in the array. |
+| fieldName | string | The field to create an ascending ordering for. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
-### ascending(fieldName) {:#ascending_e5b0480}
+A new `Ordering` for ascending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an that sorts documents in ascending order based on a field.
```typescript
// Sort documents by the 'name' field in ascending order
@@ -4434,28 +3423,33 @@ firestore.pipeline().collection("users")
```
+### average(fieldName) {:#average_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs.
+
Signature:
```typescript
-export declare function ascending(fieldName: string): Ordering;
+export declare function average(fieldName: string): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field to create an ascending ordering for. A new Ordering for ascending sorting. |
+| fieldName | string | The name of the field containing numeric values to average. |
Returns:
-[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
+[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### average(fieldName) {:#average_e5b0480}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'average' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs.
```typescript
// Calculate the average age of users
@@ -4463,28 +3457,33 @@ average("age").as("averageAge");
```
+### byteLength(fieldName) {:#bytelength_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.
+
Signature:
```typescript
-export declare function average(fieldName: string): AggregateFunction;
+export declare function byteLength(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing numeric values to average. A new representing the 'average' aggregation. |
+| fieldName | string | The name of the field containing the string. |
Returns:
-[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### byteLength(fieldName) {:#bytelength_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string in bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.
```typescript
// Calculate the length of the 'myString' field in bytes.
@@ -4492,28 +3491,33 @@ byteLength("myString");
```
+### ceil(fieldName) {:#ceil_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the ceiling of a numeric value.
+
Signature:
```typescript
-export declare function byteLength(fieldName: string): FunctionExpression;
+export declare function ceil(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the length of the string in bytes. |
+| fieldName | string | The name of the field to compute the ceiling of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### ceil(fieldName) {:#ceil_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the ceiling of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the ceiling of a numeric value.
```typescript
// Compute the ceiling of the 'price' field.
@@ -4521,28 +3525,33 @@ ceil("price");
```
+### charLength(fieldName) {:#charlength_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the character length of a string field in UTF8.
+
Signature:
```typescript
-export declare function ceil(fieldName: string): FunctionExpression;
+export declare function charLength(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the ceiling of. A new representing the ceiling of the numeric value. |
+| fieldName | string | The name of the field containing the string. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### charLength(fieldName) {:#charlength_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the character length of a string field in UTF8.
```typescript
// Get the character length of the 'name' field in UTF-8.
@@ -4550,28 +3559,33 @@ strLength("name");
```
+### collectionId(fieldName) {:#collectionid_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the collection ID from a path.
+
Signature:
```typescript
-export declare function charLength(fieldName: string): FunctionExpression;
+export declare function collectionId(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the length of the string. |
+| fieldName | string | The name of the field to get the collection ID from. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### collectionId(fieldName) {:#collectionid_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the collectionId operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the collection ID from a path.
```typescript
// Get the collection ID from a path.
@@ -4579,28 +3593,35 @@ collectionId("__name__");
```
+### concat(fieldName, second, others) {:#concat_828272e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
+
Signature:
```typescript
-export declare function collectionId(fieldName: string): FunctionExpression;
+export declare function concat(fieldName: string, second: Expression | unknown, ...others: ArrayExpression representing the concatenation. |
+| fieldName | string | The name of the field containing the first vector. |
+| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles) or [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### cosineDistance(fieldName, vector) {:#cosinedistance_463a23e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between a field's vector value and a literal vector value.
```typescript
// Calculate the Cosine distance between the 'location' field and a target location
@@ -4639,10 +3664,17 @@ cosineDistance("location", [37.7749, -122.4194]);
```
+### cosineDistance(fieldName, vectorExpression) {:#cosinedistance_ed766a1}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Cosine distance between a field's vector value and a vector expression.
+
Signature:
```typescript
-export declare function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpression;
+export declare function cosineDistance(fieldName: string, vectorExpression: Expression): FunctionExpression;
```
#### Parameters
@@ -4650,18 +3682,16 @@ export declare function cosineDistance(fieldName: string, vector: number[] | Vec
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the first vector. |
-| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles) or [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) to compare against. A new representing the Cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### cosineDistance(fieldName, vectorExpression) {:#cosinedistance_ed766a1}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between a field's vector value and a vector expression.
```typescript
// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
@@ -4669,29 +3699,33 @@ cosineDistance("userVector", field("itemVector"));
```
+### count(fieldName) {:#count_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of stage inputs where the input field exists.
+
Signature:
```typescript
-export declare function cosineDistance(fieldName: string, vectorExpression: Expression): FunctionExpression;
+export declare function count(fieldName: string): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the first vector. |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. |
+| fieldName | string | The name of the field to count. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### count(fieldName) {:#count_e5b0480}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'count' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of stage inputs where the input field exists.
```typescript
// Count the total number of products
@@ -4699,28 +3733,33 @@ count("productId").as("totalProducts");
```
+### descending(fieldName) {:#descending_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on a field.
+
Signature:
```typescript
-export declare function count(fieldName: string): AggregateFunction;
+export declare function descending(fieldName: string): Ordering;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to count. A new representing the 'count' aggregation. |
+| fieldName | string | The field to create a descending ordering for. |
Returns:
-[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
+[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
-### descending(fieldName) {:#descending_e5b0480}
+A new `Ordering` for descending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an that sorts documents in descending order based on a field.
```typescript
// Sort documents by the 'name' field in descending order
@@ -4729,28 +3768,34 @@ firestore.pipeline().collection("users")
```
+### divide(fieldName, expressions) {:#divide_cf36e43}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides a field's value by an expression.
+
Signature:
```typescript
-export declare function descending(fieldName: string): Ordering;
+export declare function divide(fieldName: string, expressions: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field to create a descending ordering for. A new Ordering for descending sorting. |
+| fieldName | string | The field name to be divided. |
+| expressions | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to divide by. |
Returns:
-[Ordering](./firestore_lite_pipelines.ordering.md#ordering_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### divide(fieldName, expressions) {:#divide_cf36e43}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides a field's value by an expression.
```typescript
// Divide the 'total' field by the 'count' field
@@ -4758,10 +3803,17 @@ divide("total", field("count"));
```
+### divide(fieldName, value) {:#divide_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides a field's value by a constant value.
+
Signature:
```typescript
-export declare function divide(fieldName: string, expressions: Expression): FunctionExpression;
+export declare function divide(fieldName: string, value: unknown): FunctionExpression;
```
#### Parameters
@@ -4769,18 +3821,16 @@ export declare function divide(fieldName: string, expressions: Expression): Func
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to be divided. |
-| expressions | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to divide by. A new representing the division operation. |
+| value | unknown | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### divide(fieldName, value) {:#divide_65e2f32}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides a field's value by a constant value.
```typescript
// Divide the 'value' field by 10
@@ -4788,29 +3838,34 @@ divide("value", 10);
```
+### dotProduct(fieldName, vector) {:#dotproduct_463a23e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between a field's vector value and a double array.
+
Signature:
```typescript
-export declare function divide(fieldName: string, value: unknown): FunctionExpression;
+export declare function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to be divided. |
-| value | unknown | The constant value to divide by. A new representing the division operation. |
+| fieldName | string | The name of the field containing the first vector. |
+| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(fieldName, vector) {:#dotproduct_463a23e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between a field's vector value and a double array.
```typescript
// Calculate the dot product distance between a feature vector and a target vector
@@ -4818,10 +3873,17 @@ dotProduct("features", [0.5, 0.8, 0.2]);
```
+### dotProduct(fieldName, vectorExpression) {:#dotproduct_ed766a1}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between a field's vector value and a vector expression.
+
Signature:
```typescript
-export declare function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpression;
+export declare function dotProduct(fieldName: string, vectorExpression: Expression): FunctionExpression;
```
#### Parameters
@@ -4829,18 +3891,16 @@ export declare function dotProduct(fieldName: string, vector: number[] | VectorV
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the first vector. |
-| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. A new representing the dot product between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to calculate with. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(fieldName, vectorExpression) {:#dotproduct_ed766a1}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between a field's vector value and a vector expression.
```typescript
// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2'
@@ -4848,29 +3908,34 @@ dotProduct("docVector1", field("docVector2"));
```
+### endsWith(fieldName, suffix) {:#endswith_05ca3b0}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value ends with a given postfix.
+
Signature:
```typescript
-export declare function dotProduct(fieldName: string, vectorExpression: Expression): FunctionExpression;
+export declare function endsWith(fieldName: string, suffix: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the first vector. |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. |
+| fieldName | string | The field name to check. |
+| suffix | string | The postfix to check for. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### endsWith(fieldName, suffix) {:#endswith_05ca3b0}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value ends with a given postfix.
```typescript
// Check if the 'filename' field ends with ".txt"
@@ -4878,10 +3943,17 @@ endsWith("filename", ".txt");
```
+### endsWith(fieldName, suffix) {:#endswith_8fc0ebc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value ends with a given postfix.
+
Signature:
```typescript
-export declare function endsWith(fieldName: string, suffix: string): BooleanExpression;
+export declare function endsWith(fieldName: string, suffix: Expression): BooleanExpression;
```
#### Parameters
@@ -4889,18 +3961,16 @@ export declare function endsWith(fieldName: string, suffix: string): BooleanExpr
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. |
+| suffix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the postfix. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### endsWith(fieldName, suffix) {:#endswith_8fc0ebc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value ends with a given postfix.
```typescript
// Check if the 'url' field ends with the value of the 'extension' field
@@ -4908,29 +3978,34 @@ endsWith("url", field("extension"));
```
+### equal(fieldName, expression) {:#equal_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to an expression.
+
Signature:
```typescript
-export declare function endsWith(fieldName: string, suffix: Expression): BooleanExpression;
+export declare function equal(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to check. |
-| suffix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the postfix. A new representing the 'ends with' comparison. |
+| fieldName | string | The field name to compare. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### equal(fieldName, expression) {:#equal_1e91657}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is equal to an expression.
```typescript
// Check if the 'age' field is equal to the 'limit' field
@@ -4938,10 +4013,17 @@ equal("age", field("limit"));
```
+### equal(fieldName, value) {:#equal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to a constant value.
+
Signature:
```typescript
-export declare function equal(fieldName: string, expression: Expression): BooleanExpression;
+export declare function equal(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -4949,18 +4031,16 @@ export declare function equal(fieldName: string, expression: Expression): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the equality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### equal(fieldName, value) {:#equal_65e2f32}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is equal to a constant value.
```typescript
// Check if the 'city' field is equal to string constant "London"
@@ -4968,29 +4048,34 @@ equal("city", "London");
```
+### equalAny(fieldName, values) {:#equalany_8060b23}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
+
Signature:
```typescript
-export declare function equal(fieldName: string, value: unknown): BooleanExpression;
+export declare function equalAny(fieldName: string, values: ArrayExpr representing the equality comparison. |
+| fieldName | string | The field to compare. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The values to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### equalAny(fieldName, values) {:#equalany_8060b23}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -4998,10 +4083,17 @@ equalAny("category", [constant("Electronics"), field("primaryType")]);
```
+### equalAny(fieldName, arrayExpression) {:#equalany_48da8d9}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
+
Signature:
```typescript
-export declare function equalAny(fieldName: string, values: ArrayExpression) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### euclideanDistance(fieldName, vectorExpression) {:#euclideandistance_ed766a1}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between a field's vector value and a vector expression.
```typescript
// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
@@ -5088,29 +4188,33 @@ euclideanDistance("pointA", field("pointB"));
```
+### exists(fieldName) {:#exists_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field exists.
+
Signature:
```typescript
-export declare function euclideanDistance(fieldName: string, vectorExpression: Expression): FunctionExpression;
+export declare function exists(fieldName: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the first vector. |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. |
+| fieldName | string | The field name to check. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### exists(fieldName) {:#exists_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'exists' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field exists.
```typescript
// Check if the document has a field named "phoneNumber"
@@ -5118,81 +4222,93 @@ exists("phoneNumber");
```
+### exp(fieldName) {:#exp_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes e to the power of the expression's result.
+
Signature:
```typescript
-export declare function exists(fieldName: string): BooleanExpression;
+export declare function exp(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to check. A new representing the 'exists' check. |
+| fieldName | string | |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### exp(fieldName) {:#exp_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the exp of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes e to the power of the expression's result.
```typescript
// Compute e to the power of the 'value' field.
exp('value');
-```
- A new representing the exp of the numeric value.
+```
+
+### floor(fieldName) {:#floor_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the floor of a numeric value.
Signature:
```typescript
-export declare function exp(fieldName: string): FunctionExpression;
+export declare function floor(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | |
+| fieldName | string | The name of the field to compute the floor of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### floor(fieldName) {:#floor_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the floor of the numeric value.
+
+### greaterThan(fieldName, expression) {:#greaterthan_1e91657}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an expression that computes the floor of a numeric value.
+Creates an expression that checks if a field's value is greater than an expression.
Signature:
```typescript
-export declare function floor(fieldName: string): FunctionExpression;
+export declare function greaterThan(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the floor of. A new representing the floor of the numeric value. |
+| fieldName | string | The field name to compare. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThan(fieldName, expression) {:#greaterthan_1e91657}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than an expression.
```typescript
// Check if the value of field 'age' is greater than the value of field 'limit'
@@ -5200,10 +4316,17 @@ greaterThan("age", field("limit"));
```
+### greaterThan(fieldName, value) {:#greaterthan_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is greater than a constant value.
+
Signature:
```typescript
-export declare function greaterThan(fieldName: string, expression: Expression): BooleanExpression;
+export declare function greaterThan(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5211,18 +4334,16 @@ export declare function greaterThan(fieldName: string, expression: Expression):
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the greater than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThan(fieldName, value) {:#greaterthan_65e2f32}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than a constant value.
```typescript
// Check if the 'price' field is greater than 100
@@ -5230,10 +4351,17 @@ greaterThan("price", 100);
```
+### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_2e16acb}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is greater than or equal to an expression.
+
Signature:
```typescript
-export declare function greaterThan(fieldName: string, value: unknown): BooleanExpression;
+export declare function greaterThanOrEqual(fieldName: string, value: Expression): BooleanExpression;
```
#### Parameters
@@ -5241,18 +4369,16 @@ export declare function greaterThan(fieldName: string, value: unknown): BooleanE
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the greater than comparison. |
+| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_2e16acb}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than or equal to an expression.
```typescript
// Check if the value of field 'age' is greater than or equal to the value of field 'limit'
@@ -5260,10 +4386,17 @@ greaterThanOrEqual("age", field("limit"));
```
+### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is greater than or equal to a constant value.
+
Signature:
```typescript
-export declare function greaterThanOrEqual(fieldName: string, value: Expression): BooleanExpression;
+export declare function greaterThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5271,18 +4404,16 @@ export declare function greaterThanOrEqual(fieldName: string, value: Expression)
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the greater than or equal to comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_65e2f32}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than or equal to a constant value.
```typescript
// Check if the 'score' field is greater than or equal to 80
@@ -5290,29 +4421,33 @@ greaterThanOrEqual("score", 80);
```
+### length\_2(fieldName) {:#length_2_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string, array, map, vector, or bytes.
+
Signature:
```typescript
-export declare function greaterThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
+declare function length_2(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the greater than or equal to comparison. |
+| fieldName | string | The name of the field to calculate the length of. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### length\_2(fieldName) {:#length_2_e5b0480}
+A new `Expression` representing the length of the string, array, map, vector, or bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string, array, map, vector, or bytes.
```typescript
// Get the length of the 'name' field.
@@ -5323,28 +4458,34 @@ length("cart");
```
+### lessThan(fieldName, expression) {:#lessthan_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than an expression.
+
Signature:
```typescript
-declare function length_2(fieldName: string): FunctionExpression;
+export declare function lessThan(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to calculate the length of. A new Expr representing the length of the string, array, map, vector, or bytes. |
+| fieldName | string | The field name to compare. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(fieldName, expression) {:#lessthan_1e91657}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than an expression.
```typescript
// Check if the 'age' field is less than the 'limit' field
@@ -5352,10 +4493,17 @@ lessThan("age", field("limit"));
```
+### lessThan(fieldName, value) {:#lessthan_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than a constant value.
+
Signature:
```typescript
-export declare function lessThan(fieldName: string, expression: Expression): BooleanExpression;
+export declare function lessThan(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5363,18 +4511,16 @@ export declare function lessThan(fieldName: string, expression: Expression): Boo
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the less than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(fieldName, value) {:#lessthan_65e2f32}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than a constant value.
```typescript
// Check if the 'price' field is less than 50
@@ -5382,10 +4528,17 @@ lessThan("price", 50);
```
+### lessThanOrEqual(fieldName, expression) {:#lessthanorequal_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than or equal to an expression.
+
Signature:
```typescript
-export declare function lessThan(fieldName: string, value: unknown): BooleanExpression;
+export declare function lessThanOrEqual(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
@@ -5393,18 +4546,16 @@ export declare function lessThan(fieldName: string, value: unknown): BooleanExpr
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than comparison. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(fieldName, expression) {:#lessthanorequal_1e91657}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than or equal to an expression.
```typescript
// Check if the 'quantity' field is less than or equal to the 'limit' field
@@ -5412,10 +4563,17 @@ lessThan("quantity", field("limit"));
```
+### lessThanOrEqual(fieldName, value) {:#lessthanorequal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than or equal to a constant value.
+
Signature:
```typescript
-export declare function lessThanOrEqual(fieldName: string, expression: Expression): BooleanExpression;
+export declare function lessThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5423,18 +4581,16 @@ export declare function lessThanOrEqual(fieldName: string, expression: Expressio
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the less than or equal to comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(fieldName, value) {:#lessthanorequal_65e2f32}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than or equal to a constant value.
```typescript
// Check if the 'score' field is less than or equal to 70
@@ -5442,29 +4598,34 @@ lessThan("score", 70);
```
+### like(fieldName, pattern) {:#like_67f7432}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive wildcard string comparison against a field.
+
Signature:
```typescript
-export declare function lessThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
+export declare function like(fieldName: string, pattern: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than or equal to comparison. |
+| fieldName | string | The name of the field containing the string. |
+| pattern | string | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### like(fieldName, pattern) {:#like_67f7432}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive wildcard string comparison against a field.
```typescript
// Check if the 'title' field contains the string "guide"
@@ -5472,10 +4633,17 @@ like("title", "%guide%");
```
+### like(fieldName, pattern) {:#like_cb1318d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive wildcard string comparison against a field.
+
Signature:
```typescript
-export declare function like(fieldName: string, pattern: string): BooleanExpression;
+export declare function like(fieldName: string, pattern: Expression): BooleanExpression;
```
#### Parameters
@@ -5483,18 +4651,16 @@ export declare function like(fieldName: string, pattern: string): BooleanExpress
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string. |
-| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. |
+| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### like(fieldName, pattern) {:#like_cb1318d}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive wildcard string comparison against a field.
```typescript
// Check if the 'title' field contains the string "guide"
@@ -5502,29 +4668,33 @@ like("title", field("pattern"));
```
+### ln(fieldName) {:#ln_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the natural logarithm of a numeric value.
+
Signature:
```typescript
-export declare function like(fieldName: string, pattern: Expression): BooleanExpression;
+export declare function ln(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. |
-| pattern | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. |
+| fieldName | string | The name of the field to compute the natural logarithm of. |
Returns:
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### ln(fieldName) {:#ln_e5b0480}
+A new `Expression` representing the natural logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the natural logarithm of a numeric value.
```typescript
// Compute the natural logarithm of the 'value' field.
@@ -5532,28 +4702,34 @@ ln("value");
```
+### log(fieldName, base) {:#log_a89e21b}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of a field to a given base.
+
Signature:
```typescript
-export declare function ln(fieldName: string): FunctionExpression;
+export declare function log(fieldName: string, base: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the natural logarithm of. A new Expr representing the natural logarithm of the numeric value. |
+| fieldName | string | The name of the field to compute the logarithm of. |
+| base | number | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### log(fieldName, base) {:#log_a89e21b}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of a field to a given base.
```typescript
// Compute the logarithm of the 'value' field with base 10.
@@ -5561,10 +4737,17 @@ log("value", 10);
```
+### log(fieldName, base) {:#log_805b11f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of a field to a given base.
+
Signature:
```typescript
-export declare function log(fieldName: string, base: number): FunctionExpression;
+export declare function log(fieldName: string, base: Expression): FunctionExpression;
```
#### Parameters
@@ -5572,18 +4755,16 @@ export declare function log(fieldName: string, base: number): FunctionExpression
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field to compute the logarithm of. |
-| base | number | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| base | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### log(fieldName, base) {:#log_805b11f}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of a field to a given base.
```typescript
// Compute the logarithm of the 'value' field with the base in the 'base' field.
@@ -5591,29 +4772,33 @@ log("value", field("base"));
```
+### log10(fieldName) {:#log10_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the base-10 logarithm of a numeric value.
+
Signature:
```typescript
-export declare function log(fieldName: string, base: Expression): FunctionExpression;
+export declare function log10(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the logarithm of. |
-| base | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| fieldName | string | The name of the field to compute the base-10 logarithm of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### log10(fieldName) {:#log10_e5b0480}
+A new `Expression` representing the base-10 logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the base-10 logarithm of a numeric value.
```typescript
// Compute the base-10 logarithm of the 'value' field.
@@ -5621,40 +4806,54 @@ log10("value");
```
+### logicalMaximum(fieldName, second, others) {:#logicalmaximum_828272e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
-export declare function log10(fieldName: string): FunctionExpression;
+export declare function logicalMaximum(fieldName: string, second: Expression | unknown, ...others: ArrayExpr representing the base-10 logarithm of the numeric value. |
+| fieldName | string | The first operand field name. |
+| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The second expression or literal. |
+| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### logicalMaximum(fieldName, second, others) {:#logicalmaximum_828272e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical maximum operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
```typescript
// Returns the largest value between the 'field1' field, the 'field2' field,
// and 1000.
logicalMaximum("field1", field("field2"), 1000);
-```
+```
+
+### logicalMinimum(fieldName, second, others) {:#logicalminimum_828272e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the smallest value between a field's value and other input expressions or literal values. Based on Firestore's value type ordering.
Signature:
```typescript
-export declare function logicalMaximum(fieldName: string, second: Expression | unknown, ...others: ArrayExpr representing the inequality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### notEqual(fieldName, value) {:#notequal_65e2f32}
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is not equal to a constant value.
```typescript
// Check if the 'country' field is not equal to "USA"
@@ -5922,10 +5158,17 @@ notEqual("country", "USA");
```
+### notEqualAny(fieldName, values) {:#notequalany_8060b23}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is not equal to any of the provided values or expressions.
+
Signature:
```typescript
-export declare function notEqual(fieldName: string, value: unknown): BooleanExpression;
+export declare function notEqualAny(fieldName: string, values: ArrayExpr representing the inequality comparison. |
+| values | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | The values to check against. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### notEqualAny(fieldName, values) {:#notequalany_8060b23}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'NOT IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is not equal to any of the provided values or expressions.
```typescript
// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
@@ -5952,10 +5193,17 @@ notEqualAny("status", [constant("pending"), field("rejectedStatus")]);
```
+### notEqualAny(fieldName, arrayExpression) {:#notequalany_48da8d9}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is not equal to any of the values in the evaluated expression.
+
Signature:
```typescript
-export declare function notEqualAny(fieldName: string, values: ArrayExpr representing the rounded value. |
+| Parameter | Type | Description |
+| --- | --- | --- |
+| fieldName | string | The name of the field to round. |
+
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new `Expression` representing the rounded value.
+
+### Example
+
-Returns:
+```typescript
+// Round the value of the 'price' field.
+round("price");
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+```
### round(fieldName, decimalPlaces) {:#round_07d0cf0}
@@ -6155,12 +5409,6 @@ export declare function round(fieldName: string): FunctionExpression;
Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-round("price", 2);
-
-```
-
Signature:
```typescript
@@ -6172,12 +5420,23 @@ export declare function round(fieldName: string, decimalPlaces: number | Express
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field to round. |
-| decimalPlaces | number \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | number \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the rounded value.
+
+### Example
+
+
+```typescript
+// Round the value of the 'price' field to two decimal places.
+round("price", 2);
+
+```
+
### split(fieldName, delimiter) {:#split_2cfdd37}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -6196,12 +5455,14 @@ export declare function split(fieldName: string, delimiter: string): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | Split the value in this field. |
-| delimiter | string | Split on this delimiter. A new representing the split function. |
+| delimiter | string | Split on this delimiter. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -6229,12 +5490,14 @@ export declare function split(fieldName: string, delimiter: Expression): Functio
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | Split the value in this field. |
-| delimiter | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. A new representing the split function. |
+| delimiter | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -6251,12 +5514,6 @@ split('scores', conditional(field('format').equal('csv'), constant(','), constan
Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt("value");
-
-```
-
Signature:
```typescript
@@ -6267,25 +5524,30 @@ export declare function sqrt(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the square root of. A new representing the square root of the numeric value. |
+| fieldName | string | The name of the field to compute the square root of. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### startsWith(fieldName, prefix) {:#startswith_89325cc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the square root of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value starts with a given prefix.
```typescript
-// Check if the 'name' field starts with "Mr."
-startsWith("name", "Mr.");
+// Compute the square root of the 'value' field.
+sqrt("value");
```
+### startsWith(fieldName, prefix) {:#startswith_89325cc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value starts with a given prefix.
+
Signature:
```typescript
@@ -6297,25 +5559,30 @@ export declare function startsWith(fieldName: string, prefix: string): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. |
+| prefix | string | The prefix to check for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### startsWith(fieldName, prefix) {:#startswith_266c338}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value starts with a given prefix.
```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-startsWith("fullName", field("firstName"));
+// Check if the 'name' field starts with "Mr."
+startsWith("name", "Mr.");
```
+### startsWith(fieldName, prefix) {:#startswith_266c338}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value starts with a given prefix.
+
Signature:
```typescript
@@ -6327,25 +5594,30 @@ export declare function startsWith(fieldName: string, prefix: Expression): Boole
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| prefix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the prefix. A new representing the 'starts with' comparison. |
+| prefix | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the prefix. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### stringConcat(fieldName, secondString, otherStrings) {:#stringconcat_d80077e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that concatenates string functions, fields or constants together.
```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-stringConcat("firstName", " ", field("lastName"));
+// Check if the 'fullName' field starts with the value of the 'firstName' field
+startsWith("fullName", field("firstName"));
```
+### stringConcat(fieldName, secondString, otherStrings) {:#stringconcat_d80077e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates string functions, fields or constants together.
+
Signature:
```typescript
@@ -6358,25 +5630,30 @@ export declare function stringConcat(fieldName: string, secondString: Expression
| --- | --- | --- |
| fieldName | string | The field name containing the initial string value. |
| secondString | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| string | An expression or string literal to concatenate. |
-| otherStrings | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| string> | Optional additional expressions or literals (typically strings) to concatenate. A new representing the concatenated string. |
+| otherStrings | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| string> | Optional additional expressions or literals (typically strings) to concatenate. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### stringContains(fieldName, substring) {:#stringcontains_5b94cfe}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the concatenated string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string field contains a specified substring.
```typescript
-// Check if the 'description' field contains "example".
-stringContains("description", "example");
+// Combine the 'firstName', " ", and 'lastName' fields into a single string
+stringConcat("firstName", " ", field("lastName"));
```
+### stringContains(fieldName, substring) {:#stringcontains_5b94cfe}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string field contains a specified substring.
+
Signature:
```typescript
@@ -6388,25 +5665,30 @@ export declare function stringContains(fieldName: string, substring: string): Bo
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string. |
-| substring | string | The substring to search for. A new representing the 'contains' comparison. |
+| substring | string | The substring to search for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### stringContains(fieldName, substring) {:#stringcontains_ac3ba47}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string field contains a substring specified by an expression.
```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-stringContains("description", field("keyword"));
+// Check if the 'description' field contains "example".
+stringContains("description", "example");
```
+### stringContains(fieldName, substring) {:#stringcontains_ac3ba47}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string field contains a substring specified by an expression.
+
Signature:
```typescript
@@ -6418,25 +5700,30 @@ export declare function stringContains(fieldName: string, substring: Expression)
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string. |
-| substring | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. |
+| substring | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the substring to search for. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### subtract(fieldName, expression) {:#subtract_1e91657}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts an expression from a field's value.
```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract("price", field("discount"));
+// Check if the 'description' field contains the value of the 'keyword' field.
+stringContains("description", field("keyword"));
```
+### subtract(fieldName, expression) {:#subtract_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts an expression from a field's value.
+
Signature:
```typescript
@@ -6448,25 +5735,30 @@ export declare function subtract(fieldName: string, expression: Expression): Fun
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to subtract from. |
-| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract. A new representing the subtraction operation. |
+| expression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### subtract(fieldName, value) {:#subtract_65e2f32}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a constant value from a field's value.
```typescript
-// Subtract 20 from the value of the 'total' field
-subtract("total", 20);
+// Subtract the 'discount' field from the 'price' field
+subtract("price", field("discount"));
```
+### subtract(fieldName, value) {:#subtract_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a constant value from a field's value.
+
Signature:
```typescript
@@ -6478,25 +5770,30 @@ export declare function subtract(fieldName: string, value: unknown): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to subtract from. |
-| value | unknown | The constant value to subtract. A new representing the subtraction operation. |
+| value | unknown | The constant value to subtract. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### sum(fieldName) {:#sum_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the sum of a field's values across multiple stage inputs.
```typescript
-// Calculate the total revenue from a set of orders
-sum("orderAmount").as("totalRevenue");
+// Subtract 20 from the value of the 'total' field
+subtract("total", 20);
```
+### sum(fieldName) {:#sum_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the sum of a field's values across multiple stage inputs.
+
Signature:
```typescript
@@ -6507,25 +5804,30 @@ export declare function sum(fieldName: string): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing numeric values to sum up. A new representing the 'sum' aggregation. |
+| fieldName | string | The name of the field containing numeric values to sum up. |
Returns:
[AggregateFunction](./firestore_lite_pipelines.aggregatefunction.md#aggregatefunction_class)
-### timestampAdd(fieldName, unit, amount) {:#timestampadd_341fe7d}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'sum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds a specified amount of time to a timestamp represented by a field.
```typescript
-// Add 1 day to the 'timestamp' field.
-timestampAdd("timestamp", "day", 1);
+// Calculate the total revenue from a set of orders
+sum("orderAmount").as("totalRevenue");
```
+### timestampAdd(fieldName, unit, amount) {:#timestampadd_341fe7d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds a specified amount of time to a timestamp represented by a field.
+
Signature:
```typescript
@@ -6538,25 +5840,30 @@ export declare function timestampAdd(fieldName: string, unit: 'microsecond' | 'm
| --- | --- | --- |
| fieldName | string | The name of the field representing the timestamp. |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). |
-| amount | number | The amount of time to add. A new representing the resulting timestamp. |
+| amount | number | The amount of time to add. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### timestampSubtract(fieldName, unit, amount) {:#timestampsubtract_341fe7d}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a specified amount of time from a timestamp represented by a field.
```typescript
-// Subtract 1 day from the 'timestamp' field.
-timestampSubtract("timestamp", "day", 1);
+// Add 1 day to the 'timestamp' field.
+timestampAdd("timestamp", "day", 1);
```
+### timestampSubtract(fieldName, unit, amount) {:#timestampsubtract_341fe7d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a specified amount of time from a timestamp represented by a field.
+
Signature:
```typescript
@@ -6569,25 +5876,30 @@ export declare function timestampSubtract(fieldName: string, unit: 'microsecond'
| --- | --- | --- |
| fieldName | string | The name of the field representing the timestamp. |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). |
-| amount | number | The amount of time to subtract. A new representing the resulting timestamp. |
+| amount | number | The amount of time to subtract. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixMicros(fieldName) {:#timestamptounixmicros_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros("timestamp");
+// Subtract 1 day from the 'timestamp' field.
+timestampSubtract("timestamp", "day", 1);
```
+### timestampToUnixMicros(fieldName) {:#timestamptounixmicros_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -6598,25 +5910,30 @@ export declare function timestampToUnixMicros(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the timestamp. A new representing the number of microseconds since epoch. |
+| fieldName | string | The name of the field representing the timestamp. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixMillis(fieldName) {:#timestamptounixmillis_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of microseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis("timestamp");
+// Convert the 'timestamp' field to microseconds since epoch.
+timestampToUnixMicros("timestamp");
```
+### timestampToUnixMillis(fieldName) {:#timestamptounixmillis_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -6627,25 +5944,30 @@ export declare function timestampToUnixMillis(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the timestamp. A new representing the number of milliseconds since epoch. |
+| fieldName | string | The name of the field representing the timestamp. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixSeconds(fieldName) {:#timestamptounixseconds_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of milliseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds("timestamp");
+// Convert the 'timestamp' field to milliseconds since epoch.
+timestampToUnixMillis("timestamp");
```
+### timestampToUnixSeconds(fieldName) {:#timestamptounixseconds_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -6656,12 +5978,23 @@ export declare function timestampToUnixSeconds(fieldName: string): FunctionExpre
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the timestamp. A new representing the number of seconds since epoch. |
+| fieldName | string | The name of the field representing the timestamp. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of seconds since epoch.
+
+### Example
+
+
+```typescript
+// Convert the 'timestamp' field to seconds since epoch.
+timestampToUnixSeconds("timestamp");
+
+```
+
### timestampTruncate(fieldName, granularity, timezone) {:#timestamptruncate_b6c7512}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -6681,12 +6014,14 @@ export declare function timestampTruncate(fieldName: string, granularity: TimeGr
| --- | --- | --- |
| fieldName | string | Truncate the timestamp value contained in this field. |
| granularity | [TimeGranularity](./firestore_lite_pipelines.md#timegranularity) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -6715,12 +6050,14 @@ export declare function timestampTruncate(fieldName: string, granularity: Expres
| --- | --- | --- |
| fieldName | string | Truncate the timestamp value contained in this field. |
| granularity | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -6737,12 +6074,6 @@ field('createdAt').timestampTruncate(field('granularity'))
Creates an expression that converts a string field to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-toLower("name");
-
-```
-
Signature:
```typescript
@@ -6753,25 +6084,30 @@ export declare function toLower(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the lowercase string. |
+| fieldName | string | The name of the field containing the string. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### toUpper(fieldName) {:#toupper_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the lowercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a string field to uppercase.
```typescript
-// Convert the 'title' field to uppercase
-toUpper("title");
+// Convert the 'name' field to lowercase
+toLower("name");
```
+### toUpper(fieldName) {:#toupper_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a string field to uppercase.
+
Signature:
```typescript
@@ -6782,28 +6118,30 @@ export declare function toUpper(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the uppercase string. |
+| fieldName | string | The name of the field containing the string. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### trim(fieldName, valueToTrim) {:#trim_c9f90ee}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the uppercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that removes leading and trailing whitespace from a string or byte array.
```typescript
-// Trim whitespace from the 'userInput' field
-trim("userInput");
-
-// Trim quotes from the 'userInput' field
-trim("userInput", '"');
+// Convert the 'title' field to uppercase
+toUpper("title");
```
+### trim(fieldName, valueToTrim) {:#trim_c9f90ee}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that removes leading and trailing whitespace from a string or byte array.
+
Signature:
```typescript
@@ -6815,12 +6153,26 @@ export declare function trim(fieldName: string, valueToTrim?: string | Expressio
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string or byte array. |
-| valueToTrim | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. A new representing the trimmed string. |
+| valueToTrim | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the trimmed string.
+
+### Example
+
+
+```typescript
+// Trim whitespace from the 'userInput' field
+trim("userInput");
+
+// Trim quotes from the 'userInput' field
+trim("userInput", '"');
+
+```
+
### type(fieldName) {:#type_e5b0480}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -6844,6 +6196,8 @@ export declare function type(fieldName: string): FunctionExpression;
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the data type.
+
### Example
@@ -6852,7 +6206,6 @@ export declare function type(fieldName: string): FunctionExpression;
type('title')
```
- A new {Expression} representing the data type.
### unixMicrosToTimestamp(fieldName) {:#unixmicrostotimestamp_e5b0480}
@@ -6861,12 +6214,6 @@ type('title')
Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp("microseconds");
-
-```
-
Signature:
```typescript
@@ -6877,25 +6224,30 @@ export declare function unixMicrosToTimestamp(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the number of microseconds since epoch. A new representing the timestamp. |
+| fieldName | string | The name of the field representing the number of microseconds since epoch. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### unixMillisToTimestamp(fieldName) {:#unixmillistotimestamp_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp("milliseconds");
+// Interpret the 'microseconds' field as microseconds since epoch.
+unixMicrosToTimestamp("microseconds");
```
+### unixMillisToTimestamp(fieldName) {:#unixmillistotimestamp_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -6906,25 +6258,30 @@ export declare function unixMillisToTimestamp(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the number of milliseconds since epoch. A new representing the timestamp. |
+| fieldName | string | The name of the field representing the number of milliseconds since epoch. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### unixSecondsToTimestamp(fieldName) {:#unixsecondstotimestamp_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp("seconds");
+// Interpret the 'milliseconds' field as milliseconds since epoch.
+unixMillisToTimestamp("milliseconds");
```
+### unixSecondsToTimestamp(fieldName) {:#unixsecondstotimestamp_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -6935,25 +6292,30 @@ export declare function unixSecondsToTimestamp(fieldName: string): FunctionExpre
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the number of seconds since epoch. A new representing the timestamp. |
+| fieldName | string | The name of the field representing the number of seconds since epoch. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### vectorLength(fieldName) {:#vectorlength_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a Firestore Vector represented by a field.
```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength("embedding");
+// Interpret the 'seconds' field as seconds since epoch.
+unixSecondsToTimestamp("seconds");
```
+### vectorLength(fieldName) {:#vectorlength_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a Firestore Vector represented by a field.
+
Signature:
```typescript
@@ -6964,12 +6326,23 @@ export declare function vectorLength(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the Firestore Vector. A new representing the length of the array. |
+| fieldName | string | The name of the field representing the Firestore Vector. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the array.
+
+### Example
+
+
+```typescript
+// Get the vector length (dimension) of the field 'embedding'.
+vectorLength("embedding");
+
+```
+
## function(first, ...)
### add(first, second) {:#add_846ca1b}
@@ -6979,12 +6352,6 @@ export declare function vectorLength(fieldName: string): FunctionExpression;
Creates an expression that adds two expressions together.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add(field("quantity"), field("reserve"));
-
-```
-
Signature:
```typescript
@@ -7002,20 +6369,24 @@ export declare function add(first: Expression, second: Expression | unknown): Fu
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### and(first, second, more) {:#and_e0c48bd}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the addition operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a logical 'AND' operation on multiple filter conditions.
```typescript
-// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND
-// the 'status' field is "active"
-const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
+// Add the value of the 'quantity' field and the 'reserve' field.
+add(field("quantity"), field("reserve"));
```
+### and(first, second, more) {:#and_e0c48bd}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a logical 'AND' operation on multiple filter conditions.
+
Signature:
```typescript
@@ -7028,25 +6399,31 @@ export declare function and(first: BooleanExpression, second: BooleanExpression,
| --- | --- | --- |
| first | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The first filter condition. |
| second | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The second filter condition. |
-| more | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'AND' together. A new representing the logical 'AND' operation. |
+| more | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'AND' together. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### concat(first, second, others) {:#concat_83be015}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical 'AND' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
```typescript
-// Concatenate the 'firstName' and 'lastName' fields with a space in between.
-concat(field("firstName"), " ", field("lastName"))
+// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND
+// the 'status' field is "active"
+const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
```
+### concat(first, second, others) {:#concat_83be015}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
+
Signature:
```typescript
@@ -7059,26 +6436,30 @@ export declare function concat(first: Expression, second: Expression | unknown,
| --- | --- | --- |
| first | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expressions to concatenate. |
| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The second literal or expression to concatenate. |
-| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Additional literals or expressions to concatenate. A new Expression representing the concatenation. |
+| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Additional literals or expressions to concatenate. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### logicalMaximum(first, second, others) {:#logicalmaximum_83be015}
+A new `Expression` representing the concatenation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
```typescript
-// Returns the largest value between the 'field1' field, the 'field2' field,
-// and 1000
-logicalMaximum(field("field1"), field("field2"), 1000);
+// Concatenate the 'firstName' and 'lastName' fields with a space in between.
+concat(field("firstName"), " ", field("lastName"))
```
+### logicalMaximum(first, second, others) {:#logicalmaximum_83be015}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
@@ -7091,26 +6472,31 @@ export declare function logicalMaximum(first: Expression, second: Expression | u
| --- | --- | --- |
| first | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first operand expression. |
| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The second expression or literal. |
-| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. A new representing the logical maximum operation. |
+| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### logicalMinimum(first, second, others) {:#logicalminimum_83be015}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical maximum operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering.
```typescript
-// Returns the smallest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMinimum(field("field1"), field("field2"), 1000);
+// Returns the largest value between the 'field1' field, the 'field2' field,
+// and 1000
+logicalMaximum(field("field1"), field("field2"), 1000);
```
+### logicalMinimum(first, second, others) {:#logicalminimum_83be015}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
@@ -7123,25 +6509,31 @@ export declare function logicalMinimum(first: Expression, second: Expression | u
| --- | --- | --- |
| first | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first operand expression. |
| second | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The second expression or literal. |
-| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. A new representing the logical minimum operation. |
+| others | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### multiply(first, second) {:#multiply_846ca1b}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical minimum operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that multiplies two expressions together.
```typescript
-// Multiply the 'quantity' field by the 'price' field
-multiply(field("quantity"), field("price"));
+// Returns the smallest value between the 'field1' field, the 'field2' field,
+// and 1000.
+logicalMinimum(field("field1"), field("field2"), 1000);
```
+### multiply(first, second) {:#multiply_846ca1b}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that multiplies two expressions together.
+
Signature:
```typescript
@@ -7159,20 +6551,24 @@ export declare function multiply(first: Expression, second: Expression | unknown
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### or(first, second, more) {:#or_e0c48bd}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the multiplication operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a logical 'OR' operation on multiple filter conditions.
```typescript
-// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR
-// the 'status' field is "active"
-const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
+// Multiply the 'quantity' field by the 'price' field
+multiply(field("quantity"), field("price"));
```
+### or(first, second, more) {:#or_e0c48bd}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a logical 'OR' operation on multiple filter conditions.
+
Signature:
```typescript
@@ -7185,29 +6581,31 @@ export declare function or(first: BooleanExpression, second: BooleanExpression,
| --- | --- | --- |
| first | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The first filter condition. |
| second | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The second filter condition. |
-| more | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'OR' together. A new representing the logical 'OR' operation. |
+| more | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'OR' together. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### xor(first, second, additionalConditions) {:#xor_8197113}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical 'OR' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions.
```typescript
-// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London",
-// or 'status' is "active".
-const condition = xor(
- greaterThan("age", 18),
- equal("city", "London"),
- equal("status", "active"));
+// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR
+// the 'status' field is "active"
+const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
```
+### xor(first, second, additionalConditions) {:#xor_8197113}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions.
+
Signature:
```typescript
@@ -7220,11 +6618,26 @@ export declare function xor(first: BooleanExpression, second: BooleanExpression,
| --- | --- | --- |
| first | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The first condition. |
| second | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class) | The second condition. |
-| additionalConditions | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional conditions to 'XOR' together. A new representing the logical 'XOR' operation. |
+| additionalConditions | [BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional conditions to 'XOR' together. |
+
+Returns:
+
+[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical 'XOR' operation.
-Returns:
+### Example
-[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+
+```typescript
+// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London",
+// or 'status' is "active".
+const condition = xor(
+ greaterThan("age", 18),
+ equal("city", "London"),
+ equal("status", "active"));
+
+```
## function(firstArray, ...)
@@ -7235,12 +6648,6 @@ export declare function xor(first: BooleanExpression, second: BooleanExpression,
Creates an expression that concatenates an array expression with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat(field("items"), [field("newItems"), field("otherItems")]);
-
-```
-
Signature:
```typescript
@@ -7253,12 +6660,23 @@ export declare function arrayConcat(firstArray: Expression, secondArray: Express
| --- | --- | --- |
| firstArray | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first array expression to concatenate to. |
| secondArray | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown\[\] | The second array expression or array literal to concatenate to. |
-| otherArrays | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. A new representing the concatenated array. |
+| otherArrays | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the concatenated array.
+
+### Example
+
+
+```typescript
+// Combine the 'items' array with two new item arrays
+arrayConcat(field("items"), [field("newItems"), field("otherItems")]);
+
+```
+
## function(firstArrayField, ...)
### arrayConcat(firstArrayField, secondArray, otherArrays) {:#arrayconcat_f92063d}
@@ -7268,12 +6686,6 @@ export declare function arrayConcat(firstArray: Expression, secondArray: Express
Creates an expression that concatenates a field's array value with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat("items", [field("newItems"), field("otherItems")]);
-
-```
-
Signature:
```typescript
@@ -7286,12 +6698,23 @@ export declare function arrayConcat(firstArrayField: string, secondArray: Expres
| --- | --- | --- |
| firstArrayField | string | The first array to concatenate to. |
| secondArray | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown\[\] | The second array expression or array literal to concatenate to. |
-| otherArrays | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. A new representing the concatenated array. |
+| otherArrays | Array<[Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the concatenated array.
+
+### Example
+
+
+```typescript
+// Combine the 'items' array with two new item arrays
+arrayConcat("items", [field("newItems"), field("otherItems")]);
+
+```
+
## function(firstMap, ...)
### mapMerge(firstMap, secondMap, otherMaps) {:#mapmerge_cfe77ce}
@@ -7301,13 +6724,6 @@ export declare function arrayConcat(firstArrayField: string, secondArray: Expres
Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge(field('settings'), { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
-
Signature:
```typescript
@@ -7326,6 +6742,16 @@ export declare function mapMerge(firstMap: RecordifExpr evaluates to an absent value. A new \[Expression\] representing the ifAbsent operation. |
+| elseValue | unknown | The value that will be returned if ifExpr evaluates to an absent value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new \[Expression\] representing the ifAbsent operation.
+
+### Example
+
+
+```typescript
+// Returns the value of the optional field 'optional_field', or returns 'default_value'
+// if the field is absent.
+ifAbsent(field("optional_field"), "default_value")
+
+```
+
## function(ifFieldName, ...)
### ifAbsent(ifFieldName, elseExpr) {:#ifabsent_e6dabea}
@@ -7432,13 +6873,6 @@ export declare function ifAbsent(ifExpr: Expression, elseValue: unknown): Expres
Creates an expression that returns the `elseExpr` argument if `ifFieldName` is absent, else return the value of the field.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns the value of
-// 'default_field' if 'optional_field' is absent.
-ifAbsent("optional_field", field("default_field"))
-
-```
-
Signature:
```typescript
@@ -7450,26 +6884,31 @@ export declare function ifAbsent(ifFieldName: string, elseExpr: Expression): Exp
| Parameter | Type | Description |
| --- | --- | --- |
| ifFieldName | string | The field to check for absence. |
-| elseExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that will be evaluated and returned if ifFieldName is absent. A new Expression representing the ifAbsent operation. |
+| elseExpr | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression that will be evaluated and returned if ifFieldName is absent. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
-### ifAbsent(ifFieldName, elseValue) {:#ifabsent_d8f2823}
+A new Expression representing the ifAbsent operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `elseValue` argument if `ifFieldName` is absent, else return the value of the field.
```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent("optional_field", "default_value")
+// Returns the value of the optional field 'optional_field', or returns the value of
+// 'default_field' if 'optional_field' is absent.
+ifAbsent("optional_field", field("default_field"))
```
+### ifAbsent(ifFieldName, elseValue) {:#ifabsent_d8f2823}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `elseValue` argument if `ifFieldName` is absent, else return the value of the field.
+
Signature:
```typescript
@@ -7481,12 +6920,24 @@ export declare function ifAbsent(ifFieldName: string | Expression, elseValue: Ex
| Parameter | Type | Description |
| --- | --- | --- |
| ifFieldName | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The field to check for absence. |
-| elseValue | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The value that will be returned if \[ifFieldName\] is absent. A new Expression representing the ifAbsent operation. |
+| elseValue | [Expression](./firestore_lite_pipelines.expression.md#expression_class) \| unknown | The value that will be returned if \[ifFieldName\] is absent. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new Expression representing the ifAbsent operation.
+
+### Example
+
+
+```typescript
+// Returns the value of the optional field 'optional_field', or returns 'default_value'
+// if the field is absent.
+ifAbsent("optional_field", "default_value")
+
+```
+
## function(input, ...)
### substring(input, position, length) {:#substring_e6e0aa3}
@@ -7548,12 +6999,6 @@ export declare function substring(input: Expression, position: Expression, lengt
Creates an expression that divides two expressions.
-```typescript
-// Divide the 'total' field by the 'count' field
-divide(field("total"), field("count"));
-
-```
-
Signature:
```typescript
@@ -7565,25 +7010,30 @@ export declare function divide(left: Expression, right: Expression): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to be divided. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to divide by. A new representing the division operation. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to divide by. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### equal(left, right) {:#equal_b3c3382}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if two expressions are equal.
```typescript
-// Check if the 'age' field is equal to an expression
-equal(field("age"), field("minAge").add(10));
+// Divide the 'total' field by the 'count' field
+divide(field("total"), field("count"));
```
+### equal(left, right) {:#equal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if two expressions are equal.
+
Signature:
```typescript
@@ -7595,25 +7045,30 @@ export declare function equal(left: Expression, right: Expression): BooleanExpre
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the equality comparison. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThan(left, right) {:#greaterthan_b3c3382}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is greater than the second expression.
```typescript
-// Check if the 'age' field is greater than 18
-greaterThan(field("age"), Constant(9).add(9));
+// Check if the 'age' field is equal to an expression
+equal(field("age"), field("minAge").add(10));
```
+### greaterThan(left, right) {:#greaterthan_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is greater than the second expression.
+
Signature:
```typescript
@@ -7625,25 +7080,30 @@ export declare function greaterThan(left: Expression, right: Expression): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the greater than comparison. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(left, right) {:#greaterthanorequal_b3c3382}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is greater than or equal to the second expression.
```typescript
-// Check if the 'quantity' field is greater than or equal to the field "threshold"
-greaterThanOrEqual(field("quantity"), field("threshold"));
+// Check if the 'age' field is greater than 18
+greaterThan(field("age"), Constant(9).add(9));
```
+### greaterThanOrEqual(left, right) {:#greaterthanorequal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is greater than or equal to the second expression.
+
Signature:
```typescript
@@ -7655,25 +7115,30 @@ export declare function greaterThanOrEqual(left: Expression, right: Expression):
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the greater than or equal to comparison. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(left, right) {:#lessthan_b3c3382}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is less than the second expression.
```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), field("limit"));
+// Check if the 'quantity' field is greater than or equal to the field "threshold"
+greaterThanOrEqual(field("quantity"), field("threshold"));
```
+### lessThan(left, right) {:#lessthan_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is less than the second expression.
+
Signature:
```typescript
@@ -7685,25 +7150,30 @@ export declare function lessThan(left: Expression, right: Expression): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the less than comparison. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(left, right) {:#lessthanorequal_b3c3382}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is less than or equal to the second expression.
```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), field("limit"));
+// Check if the 'age' field is less than 30
+lessThan(field("age"), field("limit"));
```
+### lessThanOrEqual(left, right) {:#lessthanorequal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is less than or equal to the second expression.
+
Signature:
```typescript
@@ -7715,25 +7185,30 @@ export declare function lessThanOrEqual(left: Expression, right: Expression): Bo
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the less than or equal to comparison. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### mod(left, right) {:#mod_b3c3382}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the modulo (remainder) of dividing two expressions.
```typescript
-// Calculate the remainder of dividing 'field1' by 'field2'.
-mod(field("field1"), field("field2"));
+// Check if the 'quantity' field is less than or equal to 20
+lessThan(field("quantity"), field("limit"));
```
+### mod(left, right) {:#mod_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the modulo (remainder) of dividing two expressions.
+
Signature:
```typescript
@@ -7745,11 +7220,22 @@ export declare function mod(left: Expression, right: Expression): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The dividend expression. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The divisor expression. A new representing the modulo operation. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The divisor expression. |
+
+Returns:
+
+[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the modulo operation.
+
+### Example
+
-Returns:
+```typescript
+// Calculate the remainder of dividing 'field1' by 'field2'.
+mod(field("field1"), field("field2"));
-[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+```
### notEqual(left, right) {:#notequal_b3c3382}
@@ -7758,12 +7244,6 @@ export declare function mod(left: Expression, right: Expression): FunctionExpres
Creates an expression that checks if two expressions are not equal.
-```typescript
-// Check if the 'status' field is not equal to field 'finalState'
-notEqual(field("status"), field("finalState"));
-
-```
-
Signature:
```typescript
@@ -7775,25 +7255,30 @@ export declare function notEqual(left: Expression, right: Expression): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the inequality comparison. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### subtract(left, right) {:#subtract_b3c3382}
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts two expressions.
```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract(field("price"), field("discount"));
+// Check if the 'status' field is not equal to field 'finalState'
+notEqual(field("status"), field("finalState"));
```
+### subtract(left, right) {:#subtract_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts two expressions.
+
Signature:
```typescript
@@ -7805,12 +7290,23 @@ export declare function subtract(left: Expression, right: Expression): FunctionE
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract from. |
-| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract. A new representing the subtraction operation. |
+| right | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to subtract. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
+
+### Example
+
+
+```typescript
+// Subtract the 'discount' field from the 'price' field
+subtract(field("price"), field("discount"));
+
+```
+
## function(mapExpr, ...)
### mapRemove(mapExpr, key) {:#mapremove_23c7d51}
@@ -7820,12 +7316,6 @@ export declare function subtract(left: Expression, right: Expression): FunctionE
Creates an expression that removes a key from the map produced by evaluating an expression.
-```
-// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), 'baz');
-
-```
-
Signature:
```typescript
@@ -7843,19 +7333,23 @@ export declare function mapRemove(mapExpr: Expression, key: string): FunctionExp
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### mapRemove(mapExpr, keyExpr) {:#mapremove_9fbcaa3}
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that removes a key from the map produced by evaluating an expression.
```
// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
+mapRemove(map({foo: 'bar', baz: true}), 'baz');
+@example
```
+### mapRemove(mapExpr, keyExpr) {:#mapremove_9fbcaa3}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that removes a key from the map produced by evaluating an expression.
+
Signature:
```typescript
@@ -7873,6 +7367,16 @@ export declare function mapRemove(mapExpr: Expression, keyExpr: Expression): Fun
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+### Example
+
+
+```
+// Removes the key 'baz' from the input map.
+mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
+@example
+
+```
+
## function(mapExpression, ...)
### mapGet(mapExpression, subField) {:#mapget_688c050}
@@ -7882,12 +7386,6 @@ export declare function mapRemove(mapExpr: Expression, keyExpr: Expression): Fun
Accesses a value from a map (object) expression using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-mapGet(field("address"), "city");
-
-```
-
Signature:
```typescript
@@ -7899,12 +7397,23 @@ export declare function mapGet(mapExpression: Expression, subField: string): Fun
| Parameter | Type | Description |
| --- | --- | --- |
| mapExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the map. |
-| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. |
+| subField | string | The key to access in the map. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the value associated with the given key in the map.
+
+### Example
+
+
+```typescript
+// Get the 'city' value from the 'address' map field
+mapGet(field("address"), "city");
+
+```
+
## function(mapField, ...)
### mapMerge(mapField, secondMap, otherMaps) {:#mapmerge_70a564b}
@@ -7914,13 +7423,6 @@ export declare function mapGet(mapExpression: Expression, subField: string): Fun
Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge('settings', { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
-
Signature:
```typescript
@@ -7939,6 +7441,16 @@ export declare function mapMerge(mapField: string, secondMap: Record
+
+Signature:
+
+```typescript
+export declare function execute(pipeline: Pipeline): Promise
+### Example
-Constant instance. |
+| value | number | The number value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_6dac335}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -8977,12 +8636,14 @@ export declare function constant(value: VectorValue): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. |
+| value | [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The VectorValue value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_7c807cd}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9000,12 +8661,14 @@ export declare function constant(value: string): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | string | The string value. A new Constant instance. |
+| value | string | The string value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_b2e4f8d}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9023,12 +8686,14 @@ export declare function constant(value: boolean): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | boolean | The boolean value. A new Constant instance. |
+| value | boolean | The boolean value. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_73ebd84}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9046,12 +8711,14 @@ export declare function constant(value: null): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | null | The null value. A new Constant instance. |
+| value | null | The null value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_72a76cb}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9069,12 +8736,14 @@ export declare function constant(value: GeoPoint): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | The GeoPoint value. A new Constant instance. |
+| value | [GeoPoint](./firestore_lite.geopoint.md#geopoint_class) | The GeoPoint value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_000477d}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9092,12 +8761,14 @@ export declare function constant(value: Timestamp): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | The Timestamp value. A new Constant instance. |
+| value | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) | The Timestamp value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_5131bf7}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9115,12 +8786,14 @@ export declare function constant(value: Date): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | Date | The Date value. A new Constant instance. |
+| value | Date | The Date value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_fdf565d}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9138,12 +8811,14 @@ export declare function constant(value: Bytes): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Bytes](./firestore_lite.bytes.md#bytes_class) | The Bytes value. A new Constant instance. |
+| value | [Bytes](./firestore_lite.bytes.md#bytes_class) | The Bytes value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_bcd2b0b}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9161,12 +8836,14 @@ export declare function constant(value: DocumentReference): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | The DocumentReference value. A new Constant instance. |
+| value | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) | The DocumentReference value. |
Returns:
[Expression](./firestore_lite_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### exists(value) {:#exists_f3daf14}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9174,12 +8851,6 @@ export declare function constant(value: DocumentReference): Expression;
Creates an expression that checks if a field exists.
-```typescript
-// Check if the document has a field named "phoneNumber"
-exists(field("phoneNumber"));
-
-```
-
Signature:
```typescript
@@ -9190,25 +8861,30 @@ export declare function exists(value: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluates to the name of the field to check. A new representing the 'exists' check. |
+| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | An expression evaluates to the name of the field to check. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### isAbsent(value) {:#isabsent_f3daf14}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'exists' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns `true` if a value is absent. Otherwise, returns `false` even if the value is `null`.
```typescript
-// Check if the field `value` is absent.
-isAbsent(field("value"));
+// Check if the document has a field named "phoneNumber"
+exists(field("phoneNumber"));
```
+### isAbsent(value) {:#isabsent_f3daf14}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns `true` if a value is absent. Otherwise, returns `false` even if the value is `null`.
+
Signature:
```typescript
@@ -9219,25 +8895,30 @@ export declare function isAbsent(value: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to check. A new representing the 'isAbsent' check. |
+| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to check. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
-### isError(value) {:#iserror_f3daf14}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'isAbsent' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a given expression produces an error.
```typescript
-// Check if the result of a calculation is an error
-isError(field("title").arrayContains(1));
+// Check if the field `value` is absent.
+isAbsent(field("value"));
```
+### isError(value) {:#iserror_f3daf14}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a given expression produces an error.
+
Signature:
```typescript
@@ -9248,12 +8929,23 @@ export declare function isError(value: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to check. A new representing the 'isError' check. |
+| value | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression to check. |
Returns:
[BooleanExpression](./firestore_lite_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'isError' check.
+
+### Example
+
+
+```typescript
+// Check if the result of a calculation is an error
+isError(field("title").arrayContains(1));
+
+```
+
## function(vectorExpression, ...)
### cosineDistance(vectorExpression, vector) {:#cosinedistance_3a80317}
@@ -9263,12 +8955,6 @@ export declare function isError(value: Expression): BooleanExpression;
Calculates the Cosine distance between a vector expression and a vector literal.
-```typescript
-// Calculate the cosine distance between the 'location' field and a target location
-cosineDistance(field("location"), [37.7749, -122.4194]);
-
-```
-
Signature:
```typescript
@@ -9279,26 +8965,31 @@ export declare function cosineDistance(vectorExpression: Expression, vector: num
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. A new representing the cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### cosineDistance(vectorExpression, otherVectorExpression) {:#cosinedistance_17b5bcc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between two vector expressions.
```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-cosineDistance(field("userVector"), field("itemVector"));
+// Calculate the cosine distance between the 'location' field and a target location
+cosineDistance(field("location"), [37.7749, -122.4194]);
```
+### cosineDistance(vectorExpression, otherVectorExpression) {:#cosinedistance_17b5bcc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Cosine distance between two vector expressions.
+
Signature:
```typescript
@@ -9309,26 +9000,31 @@ export declare function cosineDistance(vectorExpression: Expression, otherVector
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| otherVectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| otherVectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(vectorExpression, vector) {:#dotproduct_3a80317}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between a vector expression and a double array.
```typescript
-// Calculate the dot product between a feature vector and a target vector
-dotProduct(field("features"), [0.5, 0.8, 0.2]);
+// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
+cosineDistance(field("userVector"), field("itemVector"));
```
+### dotProduct(vectorExpression, vector) {:#dotproduct_3a80317}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between a vector expression and a double array.
+
Signature:
```typescript
@@ -9339,26 +9035,31 @@ export declare function dotProduct(vectorExpression: Expression, vector: number[
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to calculate with. |
-| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. A new representing the dot product between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to calculate with. |
+| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(vectorExpression, otherVectorExpression) {:#dotproduct_17b5bcc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between two vector expressions.
```typescript
-// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2'
-dotProduct(field("docVector1"), field("docVector2"));
+// Calculate the dot product between a feature vector and a target vector
+dotProduct(field("features"), [0.5, 0.8, 0.2]);
```
+### dotProduct(vectorExpression, otherVectorExpression) {:#dotproduct_17b5bcc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between two vector expressions.
+
Signature:
```typescript
@@ -9369,27 +9070,31 @@ export declare function dotProduct(vectorExpression: Expression, otherVectorExpr
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to calculate with. |
-| otherVectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to calculate with. |
+| otherVectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to calculate with. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### euclideanDistance(vectorExpression, vector) {:#euclideandistance_3a80317}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between a vector expression and a double array.
```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-
-euclideanDistance(field("location"), [37.7749, -122.4194]);
+// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2'
+dotProduct(field("docVector1"), field("docVector2"));
```
+### euclideanDistance(vectorExpression, vector) {:#euclideandistance_3a80317}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between a vector expression and a double array.
+
Signature:
```typescript
@@ -9400,26 +9105,32 @@ export declare function euclideanDistance(vectorExpression: Expression, vector:
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| vector | number\[\] \| [VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### euclideanDistance(vectorExpression, otherVectorExpression) {:#euclideandistance_17b5bcc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between two vector expressions.
```typescript
-// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
-euclideanDistance(field("pointA"), field("pointB"));
+// Calculate the Euclidean distance between the 'location' field and a target location
+
+euclideanDistance(field("location"), [37.7749, -122.4194]);
```
+### euclideanDistance(vectorExpression, otherVectorExpression) {:#euclideandistance_17b5bcc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between two vector expressions.
+
Signature:
```typescript
@@ -9430,26 +9141,31 @@ export declare function euclideanDistance(vectorExpression: Expression, otherVec
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| otherVectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| otherVectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
-### vectorLength(vectorExpression) {:#vectorlength_58a039b}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a Firestore Vector.
```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength(field("embedding"));
+// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
+euclideanDistance(field("pointA"), field("pointB"));
```
+### vectorLength(vectorExpression) {:#vectorlength_58a039b}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a Firestore Vector.
+
Signature:
```typescript
@@ -9460,18 +9176,29 @@ export declare function vectorLength(vectorExpression: Expression): FunctionExpr
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the Firestore Vector. A new representing the length of the array. |
+| vectorExpression | [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The expression representing the Firestore Vector. |
Returns:
[FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the array.
+
+### Example
+
+
+```typescript
+// Get the vector length (dimension) of the field 'embedding'.
+vectorLength(field("embedding"));
+
+```
+
## AddFieldsStageOptions
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how an AddFieldsStage is evaluated. See .
+Options defining how an AddFieldsStage is evaluated. See [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields).
Signature:
@@ -9486,7 +9213,7 @@ export declare type AddFieldsStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how an AggregateStage is evaluated. See .
+Options defining how an AggregateStage is evaluated. See [Pipeline.aggregate()](./firestore_pipelines.pipeline.md#pipelineaggregate).
Signature:
@@ -9502,7 +9229,9 @@ export declare type AggregateStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Defines the configuration options for a within a pipeline. This type extends and provides specific settings for how a collection group is identified and processed during pipeline execution.
+Defines the configuration options for a CollectionGroupStage within a pipeline. This type extends [StageOptions](./firestore_pipelines.stageoptions.md#stageoptions_interface) and provides specific settings for how a collection group is identified and processed during pipeline execution.
+
+See [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup) to create a collection group stage.
Signature:
@@ -9518,7 +9247,7 @@ export declare type CollectionGroupStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a CollectionStage is evaluated. See .
+Options defining how a CollectionStage is evaluated. See [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection).
Signature:
@@ -9534,7 +9263,7 @@ export declare type CollectionStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a DatabaseStage is evaluated. See .
+Options defining how a DatabaseStage is evaluated. See [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase).
Signature:
@@ -9547,7 +9276,7 @@ export declare type DatabaseStageOptions = StageOptions & {};
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a DistinctStage is evaluated. See .
+Options defining how a DistinctStage is evaluated. See [Pipeline.distinct()](./firestore_pipelines.pipeline.md#pipelinedistinct).
Signature:
@@ -9562,7 +9291,7 @@ export declare type DistinctStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a DocumentsStage is evaluated. See .
+Options defining how a DocumentsStage is evaluated. See [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments).
Signature:
@@ -9590,7 +9319,7 @@ export declare type ExpressionType = 'Field' | 'Constant' | 'Function' | 'Aggreg
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a FindNearestStage is evaluated. See .
+Options defining how a FindNearestStage is evaluated. See [Pipeline.findNearest()](./firestore_pipelines.pipeline.md#pipelinefindnearest).
Signature:
@@ -9609,7 +9338,7 @@ export declare type FindNearestStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a LimitStage is evaluated. See .
+Options defining how a LimitStage is evaluated. See [Pipeline.limit()](./firestore_pipelines.pipeline.md#pipelinelimit).
Signature:
@@ -9624,7 +9353,7 @@ export declare type LimitStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how an OffsetStage is evaluated. See .
+Options defining how an OffsetStage is evaluated. See [Pipeline.offset()](./firestore_pipelines.pipeline.md#pipelineoffset).
Signature:
@@ -9641,8 +9370,6 @@ export declare type OffsetStageOptions = StageOptions & {
Utility type to create an type that only allows one property of the Type param T to be set.
-type XorY = OneOf<{ x: unknown, y: unknown}> let a = { x: "foo" } // OK let b = { y: "foo" } // OK let c = { a: "foo", y: "foo" } // Not OK
-
Signature:
```typescript
@@ -9653,6 +9380,17 @@ export declare type OneOf
string: Name of an existing field - [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class): Represents the result of a function with an assigned alias name using [Expression.as()](./firestore_pipelines.expression.md#expressionas).Example: |
+| [distinct(options)](./firestore_lite_pipelines.pipeline.md#pipelinedistinct) | | (Public Preview) Returns a set of distinct values from the inputs to this stage.This stage runs through the results from previous stages to include only results with unique combinations of [Expression](./firestore_pipelines.expression.md#expression_class) values ([Field](./firestore_pipelines.field.md#field_class), [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class), etc).The parameters to this stage are defined using [Selectable](./firestore_pipelines.selectable.md#selectable_interface) expressions or strings:- string: Name of an existing field - [Field](./firestore_pipelines.field.md#field_class): References an existing document field. - [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class): Represents the result of a function with an assigned alias name using [Expression.as()](./firestore_pipelines.expression.md#expressionas).Example: |
| [findNearest(options)](./firestore_lite_pipelines.pipeline.md#pipelinefindnearest) | | (Public Preview) Performs a vector proximity search on the documents from the previous stage, returning the K-nearest documents based on the specified query vectorValue and distanceMeasure. The returned documents will be sorted in order from nearest to furthest from the query vectorValue.limit.
limit.
limit.
limit.
offset number of documents from the results of previous stages.offset number of documents from the results of previous stages.name and a set of params that control its behavior.
string : Name of an existing field
string: Name of an existing fieldother [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) given in parameter. The order of documents emitted from this stage is undefined.other [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) given in parameter. The order of documents emitted from this stage is undefined.selectable parameter, will emit an augmented document for each input array element. The input array element will augment the previous stage document by setting the alias field with the array element value.When selectable evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for the current input document, returning it as is with the alias field absent.No documents are emitted when selectable evaluates to an empty array.Example: |
+| [unnest(options)](./firestore_lite_pipelines.pipeline.md#pipelineunnest) | | (Public Preview) Produces a document for each element in an input array.For each previous stage document, this stage will emit zero or more augmented documents. The input array specified by the selectable parameter, will emit an augmented document for each input array element. The input array element will augment the previous stage document by setting the alias field with the array element value.When selectable evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for the current input document, returning it as is with the alias field absent.No documents are emitted when selectable evaluates to an empty array.Example: |
+| [where(condition)](./firestore_lite_pipelines.pipeline.md#pipelinewhere) | | (Public Preview) Filters the documents from previous stages to only include those matching the specified [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class).
offset number of documents from the results of previous stages.offset number of documents from the results of previous stages.name and a set of params that control its behavior.
other given in parameter. The order of documents emitted from this stage is undefined.other given in parameter. The order of documents emitted from this stage is undefined.selectable parameter, will emit an augmented document for each input array element. The input array element will augment the previous stage document by setting the alias field with the array element value.When selectable evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for the current input document, returning it as is with the alias field absent.No documents are emitted when selectable evaluates to an empty array.Example:
-```typescript
-// Input:
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tags": [ "comedy", "space", "adventure" ], ... }
+#### Parameters
-// Emit a book document for each tag of the book.
-firestore.pipeline().collection("books")
- .unnest(field("tags").as('tag'), 'tagIndex');
+| Parameter | Type | Description |
+| --- | --- | --- |
+| field | [Selectable](./firestore_lite_pipelines.selectable.md#selectable_interface) | The first field to add to the documents, specified as a [Selectable](./firestore_pipelines.selectable.md#selectable_interface). |
+| additionalFields | [Selectable](./firestore_lite_pipelines.selectable.md#selectable_interface)\[\] | Optional additional fields to add to the documents, specified as [Selectable](./firestore_pipelines.selectable.md#selectable_interface)s. |
-// Output:
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "comedy", "tagIndex": 0, ... }
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "space", "tagIndex": 1, ... }
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "adventure", "tagIndex": 2, ... }
+Returns:
-```
- |
-| [unnest(options)](./firestore_lite_pipelines.pipeline.md#pipelineunnest) | | (Public Preview) Produces a document for each element in an input array.For each previous stage document, this stage will emit zero or more augmented documents. The input array specified by the selectable parameter, will emit an augmented document for each input array element. The input array element will augment the previous stage document by setting the alias field with the array element value.When selectable evaluates to a non-array value (ex: number, null, absent), then the stage becomes a no-op for the current input document, returning it as is with the alias field absent.No documents are emitted when selectable evaluates to an empty array.Example:
-```typescript
-// Input:
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tags": [ "comedy", "space", "adventure" ], ... }
+[Pipeline](./firestore_lite_pipelines.pipeline.md#pipeline_class)
-// Emit a book document for each tag of the book.
-firestore.pipeline().collection("books")
- .unnest(field("tags").as('tag'), 'tagIndex');
+A new Pipeline object with this stage appended to the stage list.
-// Output:
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "comedy", "tagIndex": 0, ... }
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "space", "tagIndex": 1, ... }
-// { "title": "The Hitchhiker's Guide to the Galaxy", "tag": "adventure", "tagIndex": 2, ... }
+### Example
-```
- |
-| [where(condition)](./firestore_lite_pipelines.pipeline.md#pipelinewhere) | | (Public Preview) Filters the documents from previous stages to only include those matching the specified .
+
+
-
+### Example
-
+
+
+
+
+### Example
-
+
+
-
-undefined. {string} |
+| [createTime](./firestore_lite_pipelines.pipelineresult.md#pipelineresultcreatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (Public Preview) The time the document was created. Undefined if this result is not a document. |
+| [id](./firestore_lite_pipelines.pipelineresult.md#pipelineresultid) | | string \| undefined | (Public Preview) The ID of the document for which this PipelineResult contains data, if it is a document; otherwise undefined. |
| [ref](./firestore_lite_pipelines.pipelineresult.md#pipelineresultref) | | [DocumentReference](./firestore_lite.documentreference.md#documentreference_class) \| undefined | (Public Preview) The reference of the document, if it is a document; otherwise undefined. |
-| [updateTime](./firestore_lite_pipelines.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (Public Preview) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. {Timestamp\|undefined} |
+| [updateTime](./firestore_lite_pipelines.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_lite.timestamp.md#timestamp_class) \| undefined | (Public Preview) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. |
## Methods
@@ -46,8 +46,6 @@ export declare class PipelineResultPipelineSnapshot. |
## PipelineSnapshot.(constructor)
@@ -64,8 +64,6 @@ constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Times
The time at which the pipeline producing this result is executed.
- {Timestamp}
-
Signature:
```typescript
diff --git a/docs-devsite/firestore_lite_pipelines.pipelinesource.md b/docs-devsite/firestore_lite_pipelines.pipelinesource.md
index 6ec4d729fa..e42b7b66ec 100644
--- a/docs-devsite/firestore_lite_pipelines.pipelinesource.md
+++ b/docs-devsite/firestore_lite_pipelines.pipelinesource.md
@@ -13,9 +13,9 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Provides the entry point for defining the data source of a Firestore .
+Provides the entry point for defining the data source of a Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).
-Use the methods of this class (e.g., , , , or ) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents.
+Use the methods of this class (e.g., [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection), [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup), [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase), or [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments)) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents.
Signature:
@@ -154,7 +154,7 @@ createFrom(query: Query): Pipeline;
#### Exceptions
- Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
+`FirestoreError` Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
## PipelineSource.database()
@@ -220,7 +220,7 @@ PipelineType
#### Exceptions
- Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
+`FirestoreError` Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
## PipelineSource.documents()
@@ -247,5 +247,5 @@ PipelineType
#### Exceptions
- Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
+`FirestoreError` Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
diff --git a/docs-devsite/firestore_lite_pipelines.vectorvalue.md b/docs-devsite/firestore_lite_pipelines.vectorvalue.md
index 19a69f0bc2..3afe1d51f3 100644
--- a/docs-devsite/firestore_lite_pipelines.vectorvalue.md
+++ b/docs-devsite/firestore_lite_pipelines.vectorvalue.md
@@ -12,8 +12,6 @@ https://github.com/firebase/firebase-js-sdk
# VectorValue class
Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2).
- VectorValue
-
Signature:
```typescript
diff --git a/docs-devsite/firestore_pipelines.aggregatefunction.md b/docs-devsite/firestore_pipelines.aggregatefunction.md
index 5373c05e5a..37b927d28d 100644
--- a/docs-devsite/firestore_pipelines.aggregatefunction.md
+++ b/docs-devsite/firestore_pipelines.aggregatefunction.md
@@ -37,14 +37,7 @@ export declare class AggregateFunction
| Method | Modifiers | Description |
| --- | --- | --- |
-| [as(name)](./firestore_pipelines.aggregatefunction.md#aggregatefunctionas) | | (Public Preview) Assigns an alias to this AggregateFunction. The alias specifies the name that the aggregated value will have in the output document.
-```typescript
-// Calculate the average price of all items and assign it the alias "averagePrice".
-firestore.pipeline().collection("items")
- .aggregate(field("price").average().as("averagePrice"));
-
-```
- |
+| [as(name)](./firestore_pipelines.aggregatefunction.md#aggregatefunctionas) | | (Public Preview) Assigns an alias to this AggregateFunction. The alias specifies the name that the aggregated value will have in the output document. |
## AggregateFunction.(constructor)
@@ -84,13 +77,6 @@ exprType: ExpressionType;
Assigns an alias to this AggregateFunction. The alias specifies the name that the aggregated value will have in the output document.
-```typescript
-// Calculate the average price of all items and assign it the alias "averagePrice".
-firestore.pipeline().collection("items")
- .aggregate(field("price").average().as("averagePrice"));
-
-```
-
Signature:
```typescript
@@ -101,9 +87,21 @@ as(name: string): AliasedAggregate;
| Parameter | Type | Description |
| --- | --- | --- |
-| name | string | The alias to assign to this AggregateFunction. A new that wraps this AggregateFunction and associates it with the provided alias. |
+| name | string | The alias to assign to this AggregateFunction. |
Returns:
[AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class)
+A new [AliasedAggregate](./firestore_pipelines.aliasedaggregate.md#aliasedaggregate_class) that wraps this AggregateFunction and associates it with the provided alias.
+
+### Example
+
+
+```typescript
+// Calculate the average price of all items and assign it the alias "averagePrice".
+firestore.pipeline().collection("items")
+ .aggregate(field("price").average().as("averagePrice"));
+
+```
+
diff --git a/docs-devsite/firestore_pipelines.booleanexpression.md b/docs-devsite/firestore_pipelines.booleanexpression.md
index b4855ea111..4717d34e96 100644
--- a/docs-devsite/firestore_pipelines.booleanexpression.md
+++ b/docs-devsite/firestore_pipelines.booleanexpression.md
@@ -26,57 +26,13 @@ export declare abstract class BooleanExpression extends Expression
| Method | Modifiers | Description |
| --- | --- | --- |
-| [conditional(thenExpr, elseExpr)](./firestore_pipelines.booleanexpression.md#booleanexpressionconditional) | | (Public Preview) Creates a conditional expression that evaluates to the 'then' expression if this expression evaluates to true, or evaluates to the 'else' expression if this expressions evaluates false.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
-
-```
- |
-| [countIf()](./firestore_pipelines.booleanexpression.md#booleanexpressioncountif) | | (Public Preview) Creates an aggregation that finds the count of input documents satisfying this boolean expression.
-```typescript
-// Find the count of documents with a score greater than 90
-field("score").greaterThan(90).countIf().as("highestScore");
-
-```
- A new AggregateFunction representing the 'countIf' aggregation. |
-| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(constant(false));
-
-```
- |
-| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(false);
-
-```
- |
-| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(constant(0));
-
-```
- |
-| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(0);
-
-```
- |
-| [not()](./firestore_pipelines.booleanexpression.md#booleanexpressionnot) | | (Public Preview) Creates an expression that negates this boolean expression.
-```typescript
-// Find documents where the 'tags' field does not contain 'completed'
-field("tags").arrayContains("completed").not();
-
-```
- A new representing the negated filter condition. |
+| [conditional(thenExpr, elseExpr)](./firestore_pipelines.booleanexpression.md#booleanexpressionconditional) | | (Public Preview) Creates a conditional expression that evaluates to the 'then' expression if this expression evaluates to true, or evaluates to the 'else' expression if this expressions evaluates false. |
+| [countIf()](./firestore_pipelines.booleanexpression.md#booleanexpressioncountif) | | (Public Preview) Creates an aggregation that finds the count of input documents satisfying this boolean expression. |
+| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_pipelines.booleanexpression.md#booleanexpressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [not()](./firestore_pipelines.booleanexpression.md#booleanexpressionnot) | | (Public Preview) Creates an expression that negates this boolean expression. |
## BooleanExpression.conditional()
@@ -85,12 +41,6 @@ field("tags").arrayContains("completed").not();
Creates a conditional expression that evaluates to the 'then' expression if `this` expression evaluates to `true`, or evaluates to the 'else' expression if `this` expressions evaluates `false`.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
-
-```
-
Signature:
```typescript
@@ -102,25 +52,29 @@ conditional(thenExpr: Expression, elseExpr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| thenExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is true. |
-| elseExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. |
+| elseExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## BooleanExpression.countIf()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the conditional expression.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that finds the count of input documents satisfying this boolean expression.
```typescript
-// Find the count of documents with a score greater than 90
-field("score").greaterThan(90).countIf().as("highestScore");
+// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
+field("age").greaterThanOrEqual(18).conditional(constant("Adult"), constant("Minor"));
```
- A new `AggregateFunction` representing the 'countIf' aggregation.
+
+## BooleanExpression.countIf()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that finds the count of input documents satisfying this boolean expression.
Signature:
@@ -131,20 +85,24 @@ countIf(): AggregateFunction;
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-## BooleanExpression.ifError()
+A new `AggregateFunction` representing the 'countIf' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(constant(false));
+// Find the count of documents with a score greater than 90
+field("score").greaterThan(90).countIf().as("highestScore");
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -155,26 +113,31 @@ ifError(catchValue: BooleanExpression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The value that will be returned if this expression produces an error. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## BooleanExpression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
// Create an expression that protects against a divide by zero error
// but always returns a boolean expression.
-constant(50).divide('length').gt(1).ifError(false);
+constant(50).divide('length').gt(1).ifError(constant(false));
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -185,25 +148,31 @@ ifError(catchValue: boolean): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | boolean | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | boolean | The value that will be returned if this expression produces an error. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## BooleanExpression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
-// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(constant(0));
+// Create an expression that protects against a divide by zero error
+// but always returns a boolean expression.
+constant(50).divide('length').gt(1).ifError(false);
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -214,25 +183,30 @@ ifError(catchValue: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | [Expression](./firestore_pipelines.expression.md#expression_class) | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | [Expression](./firestore_pipelines.expression.md#expression_class) | The value that will be returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## BooleanExpression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
// Create an expression that protects against a divide by zero error.
-constant(50).divide('length').gt(1).ifError(0);
+constant(50).divide('length').gt(1).ifError(constant(0));
```
+## BooleanExpression.ifError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
+
Signature:
```typescript
@@ -243,25 +217,29 @@ ifError(catchValue: unknown): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | unknown | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | unknown | The value that will be returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## BooleanExpression.not()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that negates this boolean expression.
```typescript
-// Find documents where the 'tags' field does not contain 'completed'
-field("tags").arrayContains("completed").not();
+// Create an expression that protects against a divide by zero error.
+constant(50).divide('length').gt(1).ifError(0);
```
- A new representing the negated filter condition.
+
+## BooleanExpression.not()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that negates this boolean expression.
Signature:
@@ -272,3 +250,14 @@ not(): BooleanExpression;
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the negated filter condition.
+
+### Example
+
+
+```typescript
+// Find documents where the 'tags' field does not contain 'completed'
+field("tags").arrayContains("completed").not();
+
+```
+
diff --git a/docs-devsite/firestore_pipelines.expression.md b/docs-devsite/firestore_pipelines.expression.md
index c082bbfd5f..5c74487ae5 100644
--- a/docs-devsite/firestore_pipelines.expression.md
+++ b/docs-devsite/firestore_pipelines.expression.md
@@ -13,13 +13,13 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Represents an expression that can be evaluated to a value within the execution of a .
+Represents an expression that can be evaluated to a value within the execution of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).
Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:
- \*\*Field references:\*\* Access values from document fields. - \*\*Literals:\*\* Represent constant values (strings, numbers, booleans). - \*\*Function calls:\*\* Apply functions to one or more expressions.
-The `Expr` class provides a fluent API for building expressions. You can chain together method calls to create complex expressions.
+The `Expression` class provides a fluent API for building expressions. You can chain together method calls to create complex expressions.
Signature:
@@ -37,821 +37,134 @@ export declare abstract class Expression
| Method | Modifiers | Description |
| --- | --- | --- |
-| [abs()](./firestore_pipelines.expression.md#expressionabs) | | (Public Preview) Creates an expression that computes the absolute value of a numeric value.
-```typescript
-// Compute the absolute value of the 'price' field.
-field("price").abs();
-
-```
- A new representing the absolute value of the numeric value. |
-| [add(second)](./firestore_pipelines.expression.md#expressionadd) | | (Public Preview) Creates an expression that adds this expression to another expression.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-field("quantity").add(field("reserve"));
-
-```
- |
-| [arrayConcat(secondArray, otherArrays)](./firestore_pipelines.expression.md#expressionarrayconcat) | | (Public Preview) Creates an expression that concatenates an array expression with one or more other arrays.
-```typescript
-// Combine the 'items' array with another array field.
-field("items").arrayConcat(field("otherItems"));
-
-```
- |
-| [arrayContains(expression)](./firestore_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific element.
-```typescript
-// Check if the 'sizes' array contains the value from the 'selectedSize' field
-field("sizes").arrayContains(field("selectedSize"));
-
-```
- |
-| [arrayContains(value)](./firestore_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific value.
-```typescript
-// Check if the 'colors' array contains "red"
-field("colors").arrayContains("red");
-
-```
- |
-| [arrayContainsAll(values)](./firestore_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements.
-```typescript
-// Check if the 'tags' array contains both the value in field "tag1" and the literal value "tag2"
-field("tags").arrayContainsAll([field("tag1"), "tag2"]);
-
-```
- |
-| [arrayContainsAll(arrayExpression)](./firestore_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements.
-```typescript
-// Check if the 'tags' array contains both of the values from field "tag1" and the literal value "tag2"
-field("tags").arrayContainsAll(array([field("tag1"), "tag2"]));
-
-```
- |
-| [arrayContainsAny(values)](./firestore_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements.
-```typescript
-// Check if the 'categories' array contains either values from field "cate1" or "cate2"
-field("categories").arrayContainsAny([field("cate1"), field("cate2")]);
-
-```
- |
-| [arrayContainsAny(arrayExpression)](./firestore_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements.
-```typescript
-// Check if the 'groups' array contains either the value from the 'userGroup' field
-// or the value "guest"
-field("groups").arrayContainsAny(array([field("userGroup"), "guest"]));
-
-```
- |
-| [arrayGet(offset)](./firestore_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the 'tags' field array at index `1`.
-field('tags').arrayGet(1);
-
-```
- |
-| [arrayGet(offsetExpr)](./firestore_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-field('tags').arrayGet(field('favoriteTag'));
-
-```
- |
-| [arrayLength()](./firestore_pipelines.expression.md#expressionarraylength) | | (Public Preview) Creates an expression that calculates the length of an array.
-```typescript
-// Get the number of items in the 'cart' array
-field("cart").arrayLength();
-
-```
- A new Expr representing the length of the array. |
-| [arrayReverse()](./firestore_pipelines.expression.md#expressionarrayreverse) | | (Public Preview) Creates an expression that reverses an array.
-```typescript
-// Reverse the value of the 'myArray' field.
-field("myArray").arrayReverse();
-
-```
- A new representing the reversed array. |
-| [arraySum()](./firestore_pipelines.expression.md#expressionarraysum) | | (Public Preview) Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-field("scores").arraySum();
-
-```
- A new representing the sum of the elements in the array. |
-| [as(name)](./firestore_pipelines.expression.md#expressionas) | | (Public Preview) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values.
-```typescript
-// Calculate the total price and assign it the alias "totalPrice" and add it to the output.
-firestore.pipeline().collection("items")
- .addFields(field("price").multiply(field("quantity")).as("totalPrice"));
-
-```
- |
-| [asBoolean()](./firestore_pipelines.expression.md#expressionasboolean) | | (Public Preview) Wraps the expression in a \[BooleanExpression\]. A \[BooleanExpression\] representing the same expression. |
-| [ascending()](./firestore_pipelines.expression.md#expressionascending) | | (Public Preview) Creates an that sorts documents in ascending order based on this expression.
-```typescript
-// Sort documents by the 'name' field in ascending order
-pipeline().collection("users")
- .sort(field("name").ascending());
-
-```
- A new Ordering for ascending sorting. |
-| [average()](./firestore_pipelines.expression.md#expressionaverage) | | (Public Preview) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs.
-```typescript
-// Calculate the average age of users
-field("age").average().as("averageAge");
-
-```
- A new AggregateFunction representing the 'average' aggregation. |
-| [byteLength()](./firestore_pipelines.expression.md#expressionbytelength) | | (Public Preview) Creates an expression that calculates the length of this string expression in bytes.
-```typescript
-// Calculate the length of the 'myString' field in bytes.
-field("myString").byteLength();
-
-```
- A new representing the length of the string in bytes. |
-| [ceil()](./firestore_pipelines.expression.md#expressionceil) | | (Public Preview) Creates an expression that computes the ceiling of a numeric value.
-```typescript
-// Compute the ceiling of the 'price' field.
-field("price").ceil();
-
-```
- A new representing the ceiling of the numeric value. |
-| [charLength()](./firestore_pipelines.expression.md#expressioncharlength) | | (Public Preview) Creates an expression that calculates the character length of a string in UTF-8.
-```typescript
-// Get the character length of the 'name' field in its UTF-8 form.
-field("name").charLength();
-
-```
- A new Expr representing the length of the string. |
-| [collectionId()](./firestore_pipelines.expression.md#expressioncollectionid) | | (Public Preview) Creates an expression that returns the collection ID from a path.
-```typescript
-// Get the collection ID from a path.
-field("__path__").collectionId();
-
-```
- A new representing the collectionId operation. |
-| [concat(second, others)](./firestore_pipelines.expression.md#expressionconcat) | | (Public Preview) Creates an expression that concatenates expression results together.
-```typescript
-// Combine the 'firstName', ' ', and 'lastName' fields into a single value.
-field("firstName").concat(constant(" "), field("lastName"));
-
-```
- |
-| [cosineDistance(vectorExpression)](./firestore_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the cosine distance between two vectors.
-```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-field("userVector").cosineDistance(field("itemVector"));
-
-```
- |
-| [cosineDistance(vector)](./firestore_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the Cosine distance between two vectors.
-```typescript
-// Calculate the Cosine distance between the 'location' field and a target location
-field("location").cosineDistance(new VectorValue([37.7749, -122.4194]));
-
-```
- |
-| [count()](./firestore_pipelines.expression.md#expressioncount) | | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field.
-```typescript
-// Count the total number of products
-field("productId").count().as("totalProducts");
-
-```
- A new AggregateFunction representing the 'count' aggregation. |
-| [countDistinct()](./firestore_pipelines.expression.md#expressioncountdistinct) | | (Public Preview) Creates an aggregation that counts the number of distinct values of the expression or field.
-```typescript
-// Count the distinct number of products
-field("productId").countDistinct().as("distinctProducts");
-
-```
- A new AggregateFunction representing the 'count\_distinct' aggregation. |
-| [descending()](./firestore_pipelines.expression.md#expressiondescending) | | (Public Preview) Creates an that sorts documents in descending order based on this expression.
-```typescript
-// Sort documents by the 'createdAt' field in descending order
-firestore.pipeline().collection("users")
- .sort(field("createdAt").descending());
-
-```
- A new Ordering for descending sorting. |
-| [divide(divisor)](./firestore_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by another expression.
-```typescript
-// Divide the 'total' field by the 'count' field
-field("total").divide(field("count"));
-
-```
- |
-| [divide(divisor)](./firestore_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by a constant value.
-```typescript
-// Divide the 'value' field by 10
-field("value").divide(10);
-
-```
- |
-| [documentId()](./firestore_pipelines.expression.md#expressiondocumentid) | | (Public Preview) Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-field("__path__").documentId();
-
-```
- A new representing the documentId operation. |
-| [dotProduct(vectorExpression)](./firestore_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors.
-```typescript
-// Calculate the dot product between a feature vector and a target vector
-field("features").dotProduct([0.5, 0.8, 0.2]);
-
-```
- |
-| [dotProduct(vector)](./firestore_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors.
-```typescript
-// Calculate the dot product between a feature vector and a target vector
-field("features").dotProduct(new VectorValue([0.5, 0.8, 0.2]));
-
-```
- |
-| [endsWith(suffix)](./firestore_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix.
-```typescript
-// Check if the 'filename' field ends with ".txt"
-field("filename").endsWith(".txt");
-
-```
- |
-| [endsWith(suffix)](./firestore_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix (represented as an expression).
-```typescript
-// Check if the 'url' field ends with the value of the 'extension' field
-field("url").endsWith(field("extension"));
-
-```
- |
-| [equal(expression)](./firestore_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to another expression.
-```typescript
-// Check if the 'age' field is equal to 21
-field("age").equal(21);
-
-```
- |
-| [equal(value)](./firestore_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to a constant value.
-```typescript
-// Check if the 'city' field is equal to "London"
-field("city").equal("London");
-
-```
- |
-| [equalAny(values)](./firestore_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-field("category").equalAny("Electronics", field("primaryType"));
-
-```
- |
-| [equalAny(arrayExpression)](./firestore_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-field("category").equalAny(array(["Electronics", field("primaryType")]));
-
-```
- |
-| [euclideanDistance(vectorExpression)](./firestore_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-field("location").euclideanDistance([37.7749, -122.4194]);
-
-```
- |
-| [euclideanDistance(vector)](./firestore_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-field("location").euclideanDistance(new VectorValue([37.7749, -122.4194]));
-
-```
- |
-| [exists()](./firestore_pipelines.expression.md#expressionexists) | | (Public Preview) Creates an expression that checks if a field exists in the document.
-```typescript
-// Check if the document has a field named "phoneNumber"
-field("phoneNumber").exists();
-
-```
- A new Expr representing the 'exists' check. |
-| [exp()](./firestore_pipelines.expression.md#expressionexp) | | (Public Preview) Creates an expression that computes e to the power of this expression.
-```typescript
-// Compute e to the power of the 'value' field.
-field("value").exp();
-
-```
- A new representing the exp of the numeric value. |
-| [floor()](./firestore_pipelines.expression.md#expressionfloor) | | (Public Preview) Creates an expression that computes the floor of a numeric value.
-```typescript
-// Compute the floor of the 'price' field.
-field("price").floor();
-
-```
- A new representing the floor of the numeric value. |
-| [greaterThan(expression)](./firestore_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than another expression.
-```typescript
-// Check if the 'age' field is greater than the 'limit' field
-field("age").greaterThan(field("limit"));
-
-```
- |
-| [greaterThan(value)](./firestore_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than a constant value.
-```typescript
-// Check if the 'price' field is greater than 100
-field("price").greaterThan(100);
-
-```
- |
-| [greaterThanOrEqual(expression)](./firestore_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to another expression.
-```typescript
-// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1
-field("quantity").greaterThanOrEqual(field('requirement').add(1));
-
-```
- |
-| [greaterThanOrEqual(value)](./firestore_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to a constant value.
-```typescript
-// Check if the 'score' field is greater than or equal to 80
-field("score").greaterThanOrEqual(80);
-
-```
- |
-| [ifAbsent(elseValue)](./firestore_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of the this expression evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-field("optional_field").ifAbsent("default_value")
-
-```
- |
-| [ifAbsent(elseExpression)](./firestore_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of this expression evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or if that is
-// absent, then returns the value of the field `
-field("optional_field").ifAbsent(field('default_field'))
-
-```
- |
-| [ifError(catchExpr)](./firestore_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the result of the catchExpr argument if there is an error, else return the result of this expression.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// the entire title field if the array is empty or the field is another type.
-field("title").arrayGet(0).ifError(field("title"));
-
-```
- |
-| [ifError(catchValue)](./firestore_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// "Default Title"
-field("title").arrayGet(0).ifError("Default Title");
-
-```
- |
-| [isAbsent()](./firestore_pipelines.expression.md#expressionisabsent) | | (Public Preview) Creates an expression that returns true if the result of this expression is absent. Otherwise, returns false even if the value is null.
-```typescript
-// Check if the field `value` is absent.
-field("value").isAbsent();
-
-```
- A new representing the 'isAbsent' check. |
-| [isError()](./firestore_pipelines.expression.md#expressioniserror) | | (Public Preview) Creates an expression that checks if a given expression produces an error.
-```typescript
-// Check if the result of a calculation is an error
-field("title").arrayContains(1).isError();
-
-```
- A new representing the 'isError' check. |
-| [join(delimiterExpression)](./firestore_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-field("tags").join(field("separator"))
-
-```
- |
-| [join(delimiter)](./firestore_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array field into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-field("tags").join(", ")
-
-```
- |
-| [length()](./firestore_pipelines.expression.md#expressionlength) | | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes.
-```typescript
-// Get the length of the 'name' field.
-field("name").length();
-
-// Get the number of items in the 'cart' array.
-field("cart").length();
-
-```
- A new Expr representing the length of the string, array, map, vector, or bytes. |
-| [lessThan(experession)](./firestore_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than another expression.
-```typescript
-// Check if the 'age' field is less than 'limit'
-field("age").lessThan(field('limit'));
-
-```
- |
-| [lessThan(value)](./firestore_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than a constant value.
-```typescript
-// Check if the 'price' field is less than 50
-field("price").lessThan(50);
-
-```
- |
-| [lessThanOrEqual(expression)](./firestore_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to another expression.
-```typescript
-// Check if the 'quantity' field is less than or equal to 20
-field("quantity").lessThan(constant(20));
-
-```
- |
-| [lessThanOrEqual(value)](./firestore_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to a constant value.
-```typescript
-// Check if the 'score' field is less than or equal to 70
-field("score").lessThan(70);
-
-```
- |
-| [like(pattern)](./firestore_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison.
-```typescript
-// Check if the 'title' field contains the word "guide" (case-sensitive)
-field("title").like("%guide%");
-
-```
- |
-| [like(pattern)](./firestore_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison.
-```typescript
-// Check if the 'title' field contains the word "guide" (case-sensitive)
-field("title").like("%guide%");
-
-```
- |
-| [ln()](./firestore_pipelines.expression.md#expressionln) | | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value.
-```typescript
-// Compute the natural logarithm of the 'value' field.
-field("value").ln();
-
-```
- A new representing the natural logarithm of the numeric value. |
-| [log10()](./firestore_pipelines.expression.md#expressionlog10) | | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value.
-```typescript
-// Compute the base-10 logarithm of the 'value' field.
-field("value").log10();
-
-```
- A new representing the base-10 logarithm of the numeric value. |
-| [logicalMaximum(second, others)](./firestore_pipelines.expression.md#expressionlogicalmaximum) | | (Public Preview) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering.
-```typescript
-// Returns the larger value between the 'timestamp' field and the current timestamp.
-field("timestamp").logicalMaximum(Function.currentTimestamp());
-
-```
- |
-| [logicalMinimum(second, others)](./firestore_pipelines.expression.md#expressionlogicalminimum) | | (Public Preview) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering.
-```typescript
-// Returns the smaller value between the 'timestamp' field and the current timestamp.
-field("timestamp").logicalMinimum(Function.currentTimestamp());
-
-```
- |
-| [mapGet(subfield)](./firestore_pipelines.expression.md#expressionmapget) | | (Public Preview) Accesses a value from a map (object) field using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-field("address").mapGet("city");
-
-```
- |
-| [mapMerge(secondMap, otherMaps)](./firestore_pipelines.expression.md#expressionmapmerge) | | (Public Preview) Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-field('settings').mapMerge({ enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
- |
-| [mapRemove(key)](./firestore_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression.
-```
-// Removes the key 'baz' from the input map.
-map({foo: 'bar', baz: true}).mapRemove('baz');
-
-```
- |
-| [mapRemove(keyExpr)](./firestore_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression.
-```
-// Removes the key 'baz' from the input map.
-map({foo: 'bar', baz: true}).mapRemove(constant('baz'));
-
-```
- |
-| [maximum()](./firestore_pipelines.expression.md#expressionmaximum) | | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-field("score").maximum().as("highestScore");
-
-```
- A new AggregateFunction representing the 'maximum' aggregation. |
-| [minimum()](./firestore_pipelines.expression.md#expressionminimum) | | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs.
-```typescript
-// Find the lowest price of all products
-field("price").minimum().as("lowestPrice");
-
-```
- A new AggregateFunction representing the 'minimum' aggregation. |
-| [mod(expression)](./firestore_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression.
-```typescript
-// Calculate the remainder of dividing the 'value' field by the 'divisor' field
-field("value").mod(field("divisor"));
-
-```
- |
-| [mod(value)](./firestore_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value.
-```typescript
-// Calculate the remainder of dividing the 'value' field by 10
-field("value").mod(10);
-
-```
- |
-| [multiply(second)](./firestore_pipelines.expression.md#expressionmultiply) | | (Public Preview) Creates an expression that multiplies this expression by another expression.
-```typescript
-// Multiply the 'quantity' field by the 'price' field
-field("quantity").multiply(field("price"));
-
-```
- |
-| [notEqual(expression)](./firestore_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to another expression.
-```typescript
-// Check if the 'status' field is not equal to "completed"
-field("status").notEqual("completed");
-
-```
- |
-| [notEqual(value)](./firestore_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to a constant value.
-```typescript
-// Check if the 'country' field is not equal to "USA"
-field("country").notEqual("USA");
-
-```
- |
-| [notEqualAny(values)](./firestore_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-field("status").notEqualAny(["pending", field("rejectedStatus")]);
-
-```
- |
-| [notEqualAny(arrayExpression)](./firestore_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression.
-```typescript
-// Check if the 'status' field is not equal to any value in the field 'rejectedStatuses'
-field("status").notEqualAny(field('rejectedStatuses'));
-
-```
- |
-| [pow(exponent)](./firestore_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of another expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-field("base").pow(field("exponent"));
-
-```
- |
-| [pow(exponent)](./firestore_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of a constant value.
-```typescript
-// Raise the value of the 'base' field to the power of 2.
-field("base").pow(2);
-
-```
- |
-| [regexContains(pattern)](./firestore_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-field("description").regexContains("(?i)example");
-
-```
- |
-| [regexContains(pattern)](./firestore_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains the regular expression stored in field 'regex'
-field("description").regexContains(field("regex"));
-
-```
- |
-| [regexMatch(pattern)](./firestore_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-field("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
-
-```
- |
-| [regexMatch(pattern)](./firestore_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a regular expression stored in field 'regex'
-field("email").regexMatch(field("regex"));
-
-```
- |
-| [reverse()](./firestore_pipelines.expression.md#expressionreverse) | | (Public Preview) Creates an expression that reverses this string expression.
-```typescript
-// Reverse the value of the 'myString' field.
-field("myString").reverse();
-
-```
- A new representing the reversed string. |
-| [round()](./firestore_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number.
-```typescript
-// Round the value of the 'price' field.
-field("price").round();
-
-```
- A new Expr representing the rounded value. |
-| [round(decimalPlaces)](./firestore_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-field("price").round(2);
-
-```
- |
-| [round(decimalPlaces)](./firestore_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
+| [abs()](./firestore_pipelines.expression.md#expressionabs) | | (Public Preview) Creates an expression that computes the absolute value of a numeric value. |
+| [add(second)](./firestore_pipelines.expression.md#expressionadd) | | (Public Preview) Creates an expression that adds this expression to another expression. |
+| [arrayConcat(secondArray, otherArrays)](./firestore_pipelines.expression.md#expressionarrayconcat) | | (Public Preview) Creates an expression that concatenates an array expression with one or more other arrays. |
+| [arrayContains(expression)](./firestore_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific element. |
+| [arrayContains(value)](./firestore_pipelines.expression.md#expressionarraycontains) | | (Public Preview) Creates an expression that checks if an array contains a specific value. |
+| [arrayContainsAll(values)](./firestore_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements. |
+| [arrayContainsAll(arrayExpression)](./firestore_pipelines.expression.md#expressionarraycontainsall) | | (Public Preview) Creates an expression that checks if an array contains all the specified elements. |
+| [arrayContainsAny(values)](./firestore_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements. |
+| [arrayContainsAny(arrayExpression)](./firestore_pipelines.expression.md#expressionarraycontainsany) | | (Public Preview) Creates an expression that checks if an array contains any of the specified elements. |
+| [arrayGet(offset)](./firestore_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayGet(offsetExpr)](./firestore_pipelines.expression.md#expressionarrayget) | | (Public Preview) Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end. |
+| [arrayLength()](./firestore_pipelines.expression.md#expressionarraylength) | | (Public Preview) Creates an expression that calculates the length of an array. |
+| [arrayReverse()](./firestore_pipelines.expression.md#expressionarrayreverse) | | (Public Preview) Creates an expression that reverses an array. |
+| [arraySum()](./firestore_pipelines.expression.md#expressionarraysum) | | (Public Preview) Creates an expression that computes the sum of the elements in an array. |
+| [as(name)](./firestore_pipelines.expression.md#expressionas) | | (Public Preview) Assigns an alias to this expression.Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values. |
+| [asBoolean()](./firestore_pipelines.expression.md#expressionasboolean) | | (Public Preview) Wraps the expression in a \[BooleanExpression\]. |
+| [ascending()](./firestore_pipelines.expression.md#expressionascending) | | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on this expression. |
+| [average()](./firestore_pipelines.expression.md#expressionaverage) | | (Public Preview) Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs. |
+| [byteLength()](./firestore_pipelines.expression.md#expressionbytelength) | | (Public Preview) Creates an expression that calculates the length of this string expression in bytes. |
+| [ceil()](./firestore_pipelines.expression.md#expressionceil) | | (Public Preview) Creates an expression that computes the ceiling of a numeric value. |
+| [charLength()](./firestore_pipelines.expression.md#expressioncharlength) | | (Public Preview) Creates an expression that calculates the character length of a string in UTF-8. |
+| [collectionId()](./firestore_pipelines.expression.md#expressioncollectionid) | | (Public Preview) Creates an expression that returns the collection ID from a path. |
+| [concat(second, others)](./firestore_pipelines.expression.md#expressionconcat) | | (Public Preview) Creates an expression that concatenates expression results together. |
+| [cosineDistance(vectorExpression)](./firestore_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the cosine distance between two vectors. |
+| [cosineDistance(vector)](./firestore_pipelines.expression.md#expressioncosinedistance) | | (Public Preview) Calculates the Cosine distance between two vectors. |
+| [count()](./firestore_pipelines.expression.md#expressioncount) | | (Public Preview) Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field. |
+| [countDistinct()](./firestore_pipelines.expression.md#expressioncountdistinct) | | (Public Preview) Creates an aggregation that counts the number of distinct values of the expression or field. |
+| [descending()](./firestore_pipelines.expression.md#expressiondescending) | | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on this expression. |
+| [divide(divisor)](./firestore_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by another expression. |
+| [divide(divisor)](./firestore_pipelines.expression.md#expressiondivide) | | (Public Preview) Creates an expression that divides this expression by a constant value. |
+| [documentId()](./firestore_pipelines.expression.md#expressiondocumentid) | | (Public Preview) Creates an expression that returns the document ID from a path. |
+| [dotProduct(vectorExpression)](./firestore_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors. |
+| [dotProduct(vector)](./firestore_pipelines.expression.md#expressiondotproduct) | | (Public Preview) Calculates the dot product between two vectors. |
+| [endsWith(suffix)](./firestore_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix. |
+| [endsWith(suffix)](./firestore_pipelines.expression.md#expressionendswith) | | (Public Preview) Creates an expression that checks if a string ends with a given postfix (represented as an expression). |
+| [equal(expression)](./firestore_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to another expression. |
+| [equal(value)](./firestore_pipelines.expression.md#expressionequal) | | (Public Preview) Creates an expression that checks if this expression is equal to a constant value. |
+| [equalAny(values)](./firestore_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions. |
+| [equalAny(arrayExpression)](./firestore_pipelines.expression.md#expressionequalany) | | (Public Preview) Creates an expression that checks if this expression is equal to any of the provided values or expressions. |
+| [euclideanDistance(vectorExpression)](./firestore_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors. |
+| [euclideanDistance(vector)](./firestore_pipelines.expression.md#expressioneuclideandistance) | | (Public Preview) Calculates the Euclidean distance between two vectors. |
+| [exists()](./firestore_pipelines.expression.md#expressionexists) | | (Public Preview) Creates an expression that checks if a field exists in the document. |
+| [exp()](./firestore_pipelines.expression.md#expressionexp) | | (Public Preview) Creates an expression that computes e to the power of this expression. |
+| [floor()](./firestore_pipelines.expression.md#expressionfloor) | | (Public Preview) Creates an expression that computes the floor of a numeric value. |
+| [greaterThan(expression)](./firestore_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than another expression. |
+| [greaterThan(value)](./firestore_pipelines.expression.md#expressiongreaterthan) | | (Public Preview) Creates an expression that checks if this expression is greater than a constant value. |
+| [greaterThanOrEqual(expression)](./firestore_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to another expression. |
+| [greaterThanOrEqual(value)](./firestore_pipelines.expression.md#expressiongreaterthanorequal) | | (Public Preview) Creates an expression that checks if this expression is greater than or equal to a constant value. |
+| [ifAbsent(elseValue)](./firestore_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of the this expression evaluation. |
+| [ifAbsent(elseExpression)](./firestore_pipelines.expression.md#expressionifabsent) | | (Public Preview) Creates an expression that returns the elseValue argument if this expression results in an absent value, else return the result of this expression evaluation.
```typescript
-// Round the value of the 'price' field to two decimal places.
-field("price").round(constant(2));
+// Returns the value of the optional field 'optional_field', or if that is
+// absent, then returns the value of the field `
+field("optional_field").ifAbsent(field('default_field'))
```
|
+| [ifError(catchExpr)](./firestore_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the result of the catchExpr argument if there is an error, else return the result of this expression. |
+| [ifError(catchValue)](./firestore_pipelines.expression.md#expressioniferror) | | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of this expression. |
+| [isAbsent()](./firestore_pipelines.expression.md#expressionisabsent) | | (Public Preview) Creates an expression that returns true if the result of this expression is absent. Otherwise, returns false even if the value is null. |
+| [isError()](./firestore_pipelines.expression.md#expressioniserror) | | (Public Preview) Creates an expression that checks if a given expression produces an error. |
+| [join(delimiterExpression)](./firestore_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array into a string. |
+| [join(delimiter)](./firestore_pipelines.expression.md#expressionjoin) | | (Public Preview) Creates an expression that joins the elements of an array field into a string. |
+| [length()](./firestore_pipelines.expression.md#expressionlength) | | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
+| [lessThan(experession)](./firestore_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than another expression. |
+| [lessThan(value)](./firestore_pipelines.expression.md#expressionlessthan) | | (Public Preview) Creates an expression that checks if this expression is less than a constant value. |
+| [lessThanOrEqual(expression)](./firestore_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to another expression. |
+| [lessThanOrEqual(value)](./firestore_pipelines.expression.md#expressionlessthanorequal) | | (Public Preview) Creates an expression that checks if this expression is less than or equal to a constant value. |
+| [like(pattern)](./firestore_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison. |
+| [like(pattern)](./firestore_pipelines.expression.md#expressionlike) | | (Public Preview) Creates an expression that performs a case-sensitive string comparison. |
+| [ln()](./firestore_pipelines.expression.md#expressionln) | | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value. |
+| [log10()](./firestore_pipelines.expression.md#expressionlog10) | | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value. |
+| [logicalMaximum(second, others)](./firestore_pipelines.expression.md#expressionlogicalmaximum) | | (Public Preview) Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering. |
+| [logicalMinimum(second, others)](./firestore_pipelines.expression.md#expressionlogicalminimum) | | (Public Preview) Creates an expression that returns the smaller value between this expression and another expression, based on Firestore's value type ordering. |
+| [mapGet(subfield)](./firestore_pipelines.expression.md#expressionmapget) | | (Public Preview) Accesses a value from a map (object) field using the provided key. |
+| [mapMerge(secondMap, otherMaps)](./firestore_pipelines.expression.md#expressionmapmerge) | | (Public Preview) Creates an expression that merges multiple map values. |
+| [mapRemove(key)](./firestore_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression. |
+| [mapRemove(keyExpr)](./firestore_pipelines.expression.md#expressionmapremove) | | (Public Preview) Creates an expression that removes a key from the map produced by evaluating this expression. |
+| [maximum()](./firestore_pipelines.expression.md#expressionmaximum) | | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. |
+| [minimum()](./firestore_pipelines.expression.md#expressionminimum) | | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. |
+| [mod(expression)](./firestore_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by another expression. |
+| [mod(value)](./firestore_pipelines.expression.md#expressionmod) | | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value. |
+| [multiply(second)](./firestore_pipelines.expression.md#expressionmultiply) | | (Public Preview) Creates an expression that multiplies this expression by another expression. |
+| [notEqual(expression)](./firestore_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to another expression. |
+| [notEqual(value)](./firestore_pipelines.expression.md#expressionnotequal) | | (Public Preview) Creates an expression that checks if this expression is not equal to a constant value. |
+| [notEqualAny(values)](./firestore_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the provided values or expressions. |
+| [notEqualAny(arrayExpression)](./firestore_pipelines.expression.md#expressionnotequalany) | | (Public Preview) Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression. |
+| [pow(exponent)](./firestore_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of another expression. |
+| [pow(exponent)](./firestore_pipelines.expression.md#expressionpow) | | (Public Preview) Creates an expression that returns the value of this expression raised to the power of a constant value. |
+| [regexContains(pattern)](./firestore_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring. |
+| [regexContains(pattern)](./firestore_pipelines.expression.md#expressionregexcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified regular expression as a substring. |
+| [regexMatch(pattern)](./firestore_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression. |
+| [regexMatch(pattern)](./firestore_pipelines.expression.md#expressionregexmatch) | | (Public Preview) Creates an expression that checks if a string matches a specified regular expression. |
+| [reverse()](./firestore_pipelines.expression.md#expressionreverse) | | (Public Preview) Creates an expression that reverses this string expression. |
+| [round()](./firestore_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number. |
+| [round(decimalPlaces)](./firestore_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
+| [round(decimalPlaces)](./firestore_pipelines.expression.md#expressionround) | | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
| [split(delimiter)](./firestore_pipelines.expression.md#expressionsplit) | | (Public Preview) Creates an expression that splits the result of this expression into an array of substrings based on the provided delimiter. |
| [split(delimiter)](./firestore_pipelines.expression.md#expressionsplit) | | (Public Preview) Creates an expression that splits the result of this expression into an array of substrings based on the provided delimiter. |
-| [sqrt()](./firestore_pipelines.expression.md#expressionsqrt) | | (Public Preview) Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-field("value").sqrt();
-
-```
- A new representing the square root of the numeric value. |
-| [startsWith(prefix)](./firestore_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix.
-```typescript
-// Check if the 'name' field starts with "Mr."
-field("name").startsWith("Mr.");
-
-```
- |
-| [startsWith(prefix)](./firestore_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix (represented as an expression).
-```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-field("fullName").startsWith(field("firstName"));
-
-```
- |
-| [stringConcat(secondString, otherStrings)](./firestore_pipelines.expression.md#expressionstringconcat) | | (Public Preview) Creates an expression that concatenates string expressions together.
-```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-field("firstName").stringConcat(constant(" "), field("lastName"));
-
-```
- |
-| [stringContains(substring)](./firestore_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified substring.
-```typescript
-// Check if the 'description' field contains "example".
-field("description").stringContains("example");
-
-```
- |
-| [stringContains(expr)](./firestore_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains the string represented by another expression.
-```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-field("description").stringContains(field("keyword"));
-
-```
- |
-| [stringReverse()](./firestore_pipelines.expression.md#expressionstringreverse) | | (Public Preview) Creates an expression that reverses a string.
-```typescript
-// Reverse the value of the 'myString' field.
-field("myString").stringReverse();
-
-```
- A new representing the reversed string. |
+| [sqrt()](./firestore_pipelines.expression.md#expressionsqrt) | | (Public Preview) Creates an expression that computes the square root of a numeric value. |
+| [startsWith(prefix)](./firestore_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix. |
+| [startsWith(prefix)](./firestore_pipelines.expression.md#expressionstartswith) | | (Public Preview) Creates an expression that checks if a string starts with a given prefix (represented as an expression). |
+| [stringConcat(secondString, otherStrings)](./firestore_pipelines.expression.md#expressionstringconcat) | | (Public Preview) Creates an expression that concatenates string expressions together. |
+| [stringContains(substring)](./firestore_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains a specified substring. |
+| [stringContains(expr)](./firestore_pipelines.expression.md#expressionstringcontains) | | (Public Preview) Creates an expression that checks if a string contains the string represented by another expression. |
+| [stringReverse()](./firestore_pipelines.expression.md#expressionstringreverse) | | (Public Preview) Creates an expression that reverses a string. |
| [substring(position, length)](./firestore_pipelines.expression.md#expressionsubstring) | | (Public Preview) Creates an expression that returns a substring of the results of this expression. |
| [substring(position, length)](./firestore_pipelines.expression.md#expressionsubstring) | | (Public Preview) Creates an expression that returns a substring of the results of this expression. |
-| [subtract(subtrahend)](./firestore_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts another expression from this expression.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-field("price").subtract(field("discount"));
-
-```
- |
-| [subtract(subtrahend)](./firestore_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts a constant value from this expression.
-```typescript
-// Subtract 20 from the value of the 'total' field
-field("total").subtract(20);
-
-```
- |
-| [sum()](./firestore_pipelines.expression.md#expressionsum) | | (Public Preview) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-field("orderAmount").sum().as("totalRevenue");
-
-```
- A new AggregateFunction representing the 'sum' aggregation. |
-| [timestampAdd(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression.
-```typescript
-// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
-field("timestamp").timestampAdd(field("unit"), field("amount"));
-
-```
- |
-| [timestampAdd(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression.
-```typescript
-// Add 1 day to the 'timestamp' field.
-field("timestamp").timestampAdd("day", 1);
-
-```
- |
-| [timestampSubtract(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression.
-```typescript
-// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
-field("timestamp").timestampSubtract(field("unit"), field("amount"));
-
-```
- |
-| [timestampSubtract(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression.
-```typescript
-// Subtract 1 day from the 'timestamp' field.
-field("timestamp").timestampSubtract("day", 1);
-
-```
- |
-| [timestampToUnixMicros()](./firestore_pipelines.expression.md#expressiontimestamptounixmicros) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-field("timestamp").timestampToUnixMicros();
-
-```
- A new representing the number of microseconds since epoch. |
-| [timestampToUnixMillis()](./firestore_pipelines.expression.md#expressiontimestamptounixmillis) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-field("timestamp").timestampToUnixMillis();
-
-```
- A new representing the number of milliseconds since epoch. |
-| [timestampToUnixSeconds()](./firestore_pipelines.expression.md#expressiontimestamptounixseconds) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-field("timestamp").timestampToUnixSeconds();
-
-```
- A new representing the number of seconds since epoch. |
+| [subtract(subtrahend)](./firestore_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts another expression from this expression. |
+| [subtract(subtrahend)](./firestore_pipelines.expression.md#expressionsubtract) | | (Public Preview) Creates an expression that subtracts a constant value from this expression. |
+| [sum()](./firestore_pipelines.expression.md#expressionsum) | | (Public Preview) Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs. |
+| [timestampAdd(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression. |
+| [timestampAdd(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampadd) | | (Public Preview) Creates an expression that adds a specified amount of time to this timestamp expression. |
+| [timestampSubtract(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression. |
+| [timestampSubtract(unit, amount)](./firestore_pipelines.expression.md#expressiontimestampsubtract) | | (Public Preview) Creates an expression that subtracts a specified amount of time from this timestamp expression. |
+| [timestampToUnixMicros()](./firestore_pipelines.expression.md#expressiontimestamptounixmicros) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixMillis()](./firestore_pipelines.expression.md#expressiontimestamptounixmillis) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixSeconds()](./firestore_pipelines.expression.md#expressiontimestamptounixseconds) | | (Public Preview) Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
| [timestampTruncate(granularity, timezone)](./firestore_pipelines.expression.md#expressiontimestamptruncate) | | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
| [timestampTruncate(granularity, timezone)](./firestore_pipelines.expression.md#expressiontimestamptruncate) | | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
-| [toLower()](./firestore_pipelines.expression.md#expressiontolower) | | (Public Preview) Creates an expression that converts a string to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-field("name").toLower();
-
-```
- A new Expr representing the lowercase string. |
-| [toUpper()](./firestore_pipelines.expression.md#expressiontoupper) | | (Public Preview) Creates an expression that converts a string to uppercase.
-```typescript
-// Convert the 'title' field to uppercase
-field("title").toUpper();
-
-```
- A new Expr representing the uppercase string. |
-| [trim(valueToTrim)](./firestore_pipelines.expression.md#expressiontrim) | | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array.
-```typescript
-// Trim whitespace from the 'userInput' field
-field("userInput").trim();
-
-// Trim quotes from the 'userInput' field
-field("userInput").trim('"');
-
-```
- |
+| [toLower()](./firestore_pipelines.expression.md#expressiontolower) | | (Public Preview) Creates an expression that converts a string to lowercase. |
+| [toUpper()](./firestore_pipelines.expression.md#expressiontoupper) | | (Public Preview) Creates an expression that converts a string to uppercase. |
+| [trim(valueToTrim)](./firestore_pipelines.expression.md#expressiontrim) | | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array. |
| [type()](./firestore_pipelines.expression.md#expressiontype) | | (Public Preview) Creates an expression that returns the data type of this expression's result, as a string. |
-| [unixMicrosToTimestamp()](./firestore_pipelines.expression.md#expressionunixmicrostotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-field("microseconds").unixMicrosToTimestamp();
-
-```
- A new representing the timestamp. |
-| [unixMillisToTimestamp()](./firestore_pipelines.expression.md#expressionunixmillistotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-field("milliseconds").unixMillisToTimestamp();
-
-```
- A new representing the timestamp. |
-| [unixSecondsToTimestamp()](./firestore_pipelines.expression.md#expressionunixsecondstotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-field("seconds").unixSecondsToTimestamp();
-
-```
- A new representing the timestamp. |
-| [vectorLength()](./firestore_pipelines.expression.md#expressionvectorlength) | | (Public Preview) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression.
-```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-field("embedding").vectorLength();
-
-```
- A new representing the length of the vector. |
+| [unixMicrosToTimestamp()](./firestore_pipelines.expression.md#expressionunixmicrostotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixMillisToTimestamp()](./firestore_pipelines.expression.md#expressionunixmillistotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixSecondsToTimestamp()](./firestore_pipelines.expression.md#expressionunixsecondstotimestamp) | | (Public Preview) Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [vectorLength()](./firestore_pipelines.expression.md#expressionvectorlength) | | (Public Preview) Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression. |
## Expression.expressionType
@@ -871,28 +184,53 @@ abstract readonly expressionType: ExpressionType;
Creates an expression that computes the absolute value of a numeric value.
+Signature:
+
+```typescript
+abs(): FunctionExpression;
+```
+Returns:
+
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the absolute value of the numeric value.
+
+### Example
+
+
```typescript
// Compute the absolute value of the 'price' field.
field("price").abs();
```
- A new representing the absolute value of the numeric value.
+
+## Expression.add()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds this expression to another expression.
Signature:
```typescript
-abs(): FunctionExpression;
+add(second: Expression | unknown): FunctionExpression;
```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The expression or literal to add to this expression. |
+
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.add()
+A new `Expression` representing the addition operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds this expression to another expression.
```typescript
// Add the value of the 'quantity' field and the 'reserve' field.
@@ -900,28 +238,34 @@ field("quantity").add(field("reserve"));
```
+## Expression.arrayConcat()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates an array expression with one or more other arrays.
+
Signature:
```typescript
-add(second: Expression | unknown): FunctionExpression;
+arrayConcat(secondArray: Expression | unknown[], ...otherArrays: ArrayExpr representing the concatenated array. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The element to search for in the array. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContains()
+A new `Expression` representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains a specific element.
```typescript
// Check if the 'sizes' array contains the value from the 'selectedSize' field
@@ -959,28 +307,33 @@ field("sizes").arrayContains(field("selectedSize"));
```
+## Expression.arrayContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains a specific value.
+
Signature:
```typescript
-arrayContains(expression: Expression): BooleanExpression;
+arrayContains(value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The element to search for in the array. A new Expr representing the 'array\_contains' comparison. |
+| value | unknown | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContains()
+A new `Expression` representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains a specific value.
```typescript
// Check if the 'colors' array contains "red"
@@ -988,28 +341,33 @@ field("colors").arrayContains("red");
```
+## Expression.arrayContainsAll()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains all the specified elements.
+
Signature:
```typescript
-arrayContains(value: unknown): BooleanExpression;
+arrayContainsAll(values: ArrayExpr representing the 'array\_contains' comparison. |
+| values | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAll()
+A new `Expression` representing the 'array\_contains\_all' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains all the specified elements.
```typescript
// Check if the 'tags' array contains both the value in field "tag1" and the literal value "tag2"
@@ -1017,28 +375,33 @@ field("tags").arrayContainsAll([field("tag1"), "tag2"]);
```
+## Expression.arrayContainsAll()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains all the specified elements.
+
Signature:
```typescript
-arrayContainsAll(values: ArrayExpr representing the 'array\_contains\_all' comparison. |
+| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAll()
+A new `Expression` representing the 'array\_contains\_all' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains all the specified elements.
```typescript
// Check if the 'tags' array contains both of the values from field "tag1" and the literal value "tag2"
@@ -1046,28 +409,33 @@ field("tags").arrayContainsAll(array([field("tag1"), "tag2"]));
```
+## Expression.arrayContainsAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains any of the specified elements.
+
Signature:
```typescript
-arrayContainsAll(arrayExpression: Expression): BooleanExpression;
+arrayContainsAny(values: ArrayExpr representing the 'array\_contains\_all' comparison. |
+| values | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAny()
+A new `Expression` representing the 'array\_contains\_any' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains any of the specified elements.
```typescript
// Check if the 'categories' array contains either values from field "cate1" or "cate2"
@@ -1075,28 +443,33 @@ field("categories").arrayContainsAny([field("cate1"), field("cate2")]);
```
+## Expression.arrayContainsAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array contains any of the specified elements.
+
Signature:
```typescript
-arrayContainsAny(values: ArrayExpr representing the 'array\_contains\_any' comparison. |
+| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The elements to check for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.arrayContainsAny()
+A new `Expression` representing the 'array\_contains\_any' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array contains any of the specified elements.
```typescript
// Check if the 'groups' array contains either the value from the 'userGroup' field
@@ -1105,28 +478,33 @@ field("groups").arrayContainsAny(array([field("userGroup"), "guest"]));
```
+## Expression.arrayGet()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
-arrayContainsAny(arrayExpression: Expression): BooleanExpression;
+arrayGet(offset: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The elements to check for in the array. A new Expr representing the 'array\_contains\_any' comparison. |
+| offset | number | The index of the element to return. |
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayGet()
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
// Return the value in the 'tags' field array at index `1`.
@@ -1134,28 +512,33 @@ field('tags').arrayGet(1);
```
+## Expression.arrayGet()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
-arrayGet(offset: number): FunctionExpression;
+arrayGet(offsetExpr: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| offset | number | The index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| offsetExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expression evaluating to the index of the element to return. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayGet()
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and returns the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
// Return the value in the tags field array at index specified by field
@@ -1164,90 +547,86 @@ field('tags').arrayGet(field('favoriteTag'));
```
-Signature:
+## Expression.arrayLength()
-```typescript
-arrayGet(offsetExpr: Expression): FunctionExpression;
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-#### Parameters
+Creates an expression that calculates the length of an array.
-| Parameter | Type | Description |
-| --- | --- | --- |
-| offsetExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expr evaluating to the index of the element to return. A new Expr representing the 'arrayGet' operation. |
+Signature:
+```typescript
+arrayLength(): FunctionExpression;
+```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayLength()
+A new `Expression` representing the length of the array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of an array.
```typescript
// Get the number of items in the 'cart' array
field("cart").arrayLength();
```
- A new `Expr` representing the length of the array.
+
+## Expression.arrayReverse()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses an array.
Signature:
```typescript
-arrayLength(): FunctionExpression;
+arrayReverse(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arrayReverse()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses an array.
```typescript
// Reverse the value of the 'myArray' field.
field("myArray").arrayReverse();
```
- A new representing the reversed array.
+
+## Expression.arraySum()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the sum of the elements in an array.
Signature:
```typescript
-arrayReverse(): FunctionExpression;
+arraySum(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.arraySum()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the sum of the elements in the array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the sum of the elements in an array.
```typescript
// Compute the sum of the elements in the 'scores' field.
field("scores").arraySum();
```
- A new representing the sum of the elements in the array.
-
-Signature:
-
-```typescript
-arraySum(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
## Expression.as()
@@ -1258,13 +637,6 @@ Assigns an alias to this expression.
Aliases are useful for renaming fields in the output of a stage or for giving meaningful names to calculated values.
-```typescript
-// Calculate the total price and assign it the alias "totalPrice" and add it to the output.
-firestore.pipeline().collection("items")
- .addFields(field("price").multiply(field("quantity")).as("totalPrice"));
-
-```
-
Signature:
```typescript
@@ -1275,12 +647,24 @@ as(name: string): AliasedExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| name | string | The alias to assign to this expression. A new that wraps this expression and associates it with the provided alias. |
+| name | string | The alias to assign to this expression. |
Returns:
[AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class)
+A new [AliasedExpression](./firestore_pipelines.aliasedexpression.md#aliasedexpression_class) that wraps this expression and associates it with the provided alias.
+
+### Example
+
+
+```typescript
+// Calculate the total price and assign it the alias "totalPrice" and add it to the output.
+firestore.pipeline().collection("items")
+ .addFields(field("price").multiply(field("quantity")).as("totalPrice"));
+
+```
+
## Expression.asBoolean()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1288,8 +672,6 @@ as(name: string): AliasedExpression;
Wraps the expression in a \[BooleanExpression\].
- A \[BooleanExpression\] representing the same expression.
-
Signature:
```typescript
@@ -1299,12 +681,28 @@ asBoolean(): BooleanExpression;
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A \[BooleanExpression\] representing the same expression.
+
## Expression.ascending()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an that sorts documents in ascending order based on this expression.
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on this expression.
+
+Signature:
+
+```typescript
+ascending(): Ordering;
+```
+Returns:
+
+[Ordering](./firestore_pipelines.ordering.md#ordering_class)
+
+A new `Ordering` for ascending sorting.
+
+### Example
+
```typescript
// Sort documents by the 'name' field in ascending order
@@ -1312,131 +710,141 @@ pipeline().collection("users")
.sort(field("name").ascending());
```
- A new `Ordering` for ascending sorting.
+
+## Expression.average()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs.
Signature:
```typescript
-ascending(): Ordering;
+average(): AggregateFunction;
```
Returns:
-[Ordering](./firestore_pipelines.ordering.md#ordering_class)
+[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.average()
+A new `AggregateFunction` representing the 'average' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the average (mean) of a numeric field across multiple stage inputs.
```typescript
// Calculate the average age of users
field("age").average().as("averageAge");
```
- A new `AggregateFunction` representing the 'average' aggregation.
+
+## Expression.byteLength()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of this string expression in bytes.
Signature:
```typescript
-average(): AggregateFunction;
+byteLength(): FunctionExpression;
```
Returns:
-[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.byteLength()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string in bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of this string expression in bytes.
```typescript
// Calculate the length of the 'myString' field in bytes.
field("myString").byteLength();
```
- A new representing the length of the string in bytes.
+
+## Expression.ceil()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the ceiling of a numeric value.
Signature:
```typescript
-byteLength(): FunctionExpression;
+ceil(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.ceil()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the ceiling of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the ceiling of a numeric value.
```typescript
// Compute the ceiling of the 'price' field.
field("price").ceil();
```
- A new representing the ceiling of the numeric value.
+
+## Expression.charLength()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the character length of a string in UTF-8.
Signature:
```typescript
-ceil(): FunctionExpression;
+charLength(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.charLength()
+A new `Expression` representing the length of the string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the character length of a string in UTF-8.
```typescript
// Get the character length of the 'name' field in its UTF-8 form.
field("name").charLength();
```
- A new `Expr` representing the length of the string.
+
+## Expression.collectionId()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the collection ID from a path.
Signature:
```typescript
-charLength(): FunctionExpression;
+collectionId(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.collectionId()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the collectionId operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the collection ID from a path.
```typescript
// Get the collection ID from a path.
field("__path__").collectionId();
```
- A new representing the collectionId operation.
-
-Signature:
-
-```typescript
-collectionId(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
## Expression.concat()
@@ -1445,12 +853,6 @@ collectionId(): FunctionExpression;
Creates an expression that concatenates expression results together.
-```typescript
-// Combine the 'firstName', ' ', and 'lastName' fields into a single value.
-field("firstName").concat(constant(" "), field("lastName"));
-
-```
-
Signature:
```typescript
@@ -1462,25 +864,30 @@ concat(second: Expression | unknown, ...others: ArrayExpr representing the concatenated value. |
+| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals to concatenate. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.cosineDistance()
+A new `Expression` representing the concatenated value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the cosine distance between two vectors.
```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-field("userVector").cosineDistance(field("itemVector"));
+// Combine the 'firstName', ' ', and 'lastName' fields into a single value.
+field("firstName").concat(constant(" "), field("lastName"));
```
+## Expression.cosineDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the cosine distance between two vectors.
+
Signature:
```typescript
@@ -1491,25 +898,30 @@ cosineDistance(vectorExpression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new Expr representing the cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.cosineDistance()
+A new `Expression` representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between two vectors.
```typescript
-// Calculate the Cosine distance between the 'location' field and a target location
-field("location").cosineDistance(new VectorValue([37.7749, -122.4194]));
+// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
+field("userVector").cosineDistance(field("itemVector"));
```
+## Expression.cosineDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Cosine distance between two vectors.
+
Signature:
```typescript
@@ -1520,25 +932,29 @@ cosineDistance(vector: VectorValue | number[]): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| vector | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. A new Expr representing the Cosine\* distance between the two vectors. |
+| vector | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.count()
+A new `Expression` representing the Cosine\* distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field.
```typescript
-// Count the total number of products
-field("productId").count().as("totalProducts");
+// Calculate the Cosine distance between the 'location' field and a target location
+field("location").cosineDistance(new VectorValue([37.7749, -122.4194]));
```
- A new `AggregateFunction` representing the 'count' aggregation.
+
+## Expression.count()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of stage inputs with valid evaluations of the expression or field.
Signature:
@@ -1549,19 +965,23 @@ count(): AggregateFunction;
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.countDistinct()
+A new `AggregateFunction` representing the 'count' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of distinct values of the expression or field.
```typescript
-// Count the distinct number of products
-field("productId").countDistinct().as("distinctProducts");
+// Count the total number of products
+field("productId").count().as("totalProducts");
```
- A new `AggregateFunction` representing the 'count\_distinct' aggregation.
+
+## Expression.countDistinct()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of distinct values of the expression or field.
Signature:
@@ -1572,20 +992,23 @@ countDistinct(): AggregateFunction;
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.descending()
+A new `AggregateFunction` representing the 'count\_distinct' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an that sorts documents in descending order based on this expression.
```typescript
-// Sort documents by the 'createdAt' field in descending order
-firestore.pipeline().collection("users")
- .sort(field("createdAt").descending());
+// Count the distinct number of products
+field("productId").countDistinct().as("distinctProducts");
```
- A new `Ordering` for descending sorting.
+
+## Expression.descending()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on this expression.
Signature:
@@ -1596,19 +1019,25 @@ descending(): Ordering;
[Ordering](./firestore_pipelines.ordering.md#ordering_class)
-## Expression.divide()
+A new `Ordering` for descending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides this expression by another expression.
```typescript
-// Divide the 'total' field by the 'count' field
-field("total").divide(field("count"));
+// Sort documents by the 'createdAt' field in descending order
+firestore.pipeline().collection("users")
+ .sort(field("createdAt").descending());
```
+## Expression.divide()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides this expression by another expression.
+
Signature:
```typescript
@@ -1619,25 +1048,30 @@ divide(divisor: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| divisor | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to divide by. A new Expr representing the division operation. |
+| divisor | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to divide by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.divide()
+A new `Expression` representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides this expression by a constant value.
```typescript
-// Divide the 'value' field by 10
-field("value").divide(10);
+// Divide the 'total' field by the 'count' field
+field("total").divide(field("count"));
```
+## Expression.divide()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides this expression by a constant value.
+
Signature:
```typescript
@@ -1648,12 +1082,23 @@ divide(divisor: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| divisor | number | The constant value to divide by. A new Expr representing the division operation. |
+| divisor | number | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the division operation.
+
+### Example
+
+
+```typescript
+// Divide the 'value' field by 10
+field("value").divide(10);
+
+```
+
## Expression.documentId()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -1661,28 +1106,53 @@ divide(divisor: number): FunctionExpression;
Creates an expression that returns the document ID from a path.
+Signature:
+
+```typescript
+documentId(): FunctionExpression;
+```
+Returns:
+
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the documentId operation.
+
+### Example
+
+
```typescript
// Get the document ID from a path.
field("__path__").documentId();
```
- A new representing the documentId operation.
+
+## Expression.dotProduct()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between two vectors.
Signature:
```typescript
-documentId(): FunctionExpression;
+dotProduct(vectorExpression: Expression): FunctionExpression;
```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. |
+
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.dotProduct()
+A new `Expression` representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between two vectors.
```typescript
// Calculate the dot product between a feature vector and a target vector
@@ -1690,28 +1160,33 @@ field("features").dotProduct([0.5, 0.8, 0.2]);
```
+## Expression.dotProduct()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between two vectors.
+
Signature:
```typescript
-dotProduct(vectorExpression: Expression): FunctionExpression;
+dotProduct(vector: VectorValue | number[]): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. |
+| vector | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as an array of numbers) to calculate with. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.dotProduct()
+A new `Expression` representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between two vectors.
```typescript
// Calculate the dot product between a feature vector and a target vector
@@ -1719,28 +1194,33 @@ field("features").dotProduct(new VectorValue([0.5, 0.8, 0.2]));
```
+## Expression.endsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string ends with a given postfix.
+
Signature:
```typescript
-dotProduct(vector: VectorValue | number[]): FunctionExpression;
+endsWith(suffix: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| vector | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as an array of numbers) to calculate with. A new Expr representing the dot product between the two vectors. |
+| suffix | string | The postfix to check for. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.endsWith()
+A new `Expression` representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string ends with a given postfix.
```typescript
// Check if the 'filename' field ends with ".txt"
@@ -1748,28 +1228,33 @@ field("filename").endsWith(".txt");
```
+## Expression.endsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string ends with a given postfix (represented as an expression).
+
Signature:
```typescript
-endsWith(suffix: string): BooleanExpression;
+endsWith(suffix: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| suffix | string | The postfix to check for. A new Expr representing the 'ends with' comparison. |
+| suffix | [Expression](./firestore_pipelines.expression.md#expression_class) | The postfix expression to check for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.endsWith()
+A new `Expression` representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string ends with a given postfix (represented as an expression).
```typescript
// Check if the 'url' field ends with the value of the 'extension' field
@@ -1777,28 +1262,33 @@ field("url").endsWith(field("extension"));
```
+## Expression.equal()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to another expression.
+
Signature:
```typescript
-endsWith(suffix: Expression): BooleanExpression;
+equal(expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| suffix | [Expression](./firestore_pipelines.expression.md#expression_class) | The postfix expression to check for. A new Expr representing the 'ends with' comparison. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for equality. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equal()
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to another expression.
```typescript
// Check if the 'age' field is equal to 21
@@ -1806,28 +1296,33 @@ field("age").equal(21);
```
+## Expression.equal()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to a constant value.
+
Signature:
```typescript
-equal(expression: Expression): BooleanExpression;
+equal(value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for equality. A new Expr representing the equality comparison. |
+| value | unknown | The constant value to compare for equality. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equal()
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to a constant value.
```typescript
// Check if the 'city' field is equal to "London"
@@ -1835,28 +1330,33 @@ field("city").equal("London");
```
+## Expression.equalAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to any of the provided values or expressions.
+
Signature:
```typescript
-equal(value: unknown): BooleanExpression;
+equalAny(values: ArrayExpr representing the equality comparison. |
+| values | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | The values or expressions to check against. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equalAny()
+A new `Expression` representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -1864,28 +1364,33 @@ field("category").equalAny("Electronics", field("primaryType"));
```
+## Expression.equalAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is equal to any of the provided values or expressions.
+
Signature:
```typescript
-equalAny(values: ArrayExpr representing the 'IN' comparison. |
+| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression that evaluates to an array of values to check against. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.equalAny()
+A new `Expression` representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -1893,28 +1398,33 @@ field("category").equalAny(array(["Electronics", field("primaryType")]));
```
+## Expression.euclideanDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between two vectors.
+
Signature:
```typescript
-equalAny(arrayExpression: Expression): BooleanExpression;
+euclideanDistance(vectorExpression: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression that evaluates to an array of values to check against. A new Expr representing the 'IN' comparison. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. |
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.euclideanDistance()
+A new `Expression` representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between two vectors.
```typescript
// Calculate the Euclidean distance between the 'location' field and a target location
@@ -1922,28 +1432,33 @@ field("location").euclideanDistance([37.7749, -122.4194]);
```
+## Expression.euclideanDistance()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between two vectors.
+
Signature:
```typescript
-euclideanDistance(vectorExpression: Expression): FunctionExpression;
+euclideanDistance(vector: VectorValue | number[]): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (as an array of numbers) to calculate with. A new Expr representing the Euclidean distance between the two vectors. |
+| vector | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.euclideanDistance()
+A new `Expression` representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between two vectors.
```typescript
// Calculate the Euclidean distance between the 'location' field and a target location
@@ -1951,90 +1466,86 @@ field("location").euclideanDistance(new VectorValue([37.7749, -122.4194]));
```
-Signature:
+## Expression.exists()
-```typescript
-euclideanDistance(vector: VectorValue | number[]): FunctionExpression;
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-#### Parameters
+Creates an expression that checks if a field exists in the document.
-| Parameter | Type | Description |
-| --- | --- | --- |
-| vector | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) \| number\[\] | The other vector (as a VectorValue) to compare against. A new Expr representing the Euclidean distance between the two vectors. |
+Signature:
+```typescript
+exists(): BooleanExpression;
+```
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.exists()
+A new `Expression` representing the 'exists' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field exists in the document.
```typescript
// Check if the document has a field named "phoneNumber"
field("phoneNumber").exists();
```
- A new `Expr` representing the 'exists' check.
+
+## Expression.exp()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes e to the power of this expression.
Signature:
```typescript
-exists(): BooleanExpression;
+exp(): FunctionExpression;
```
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.exp()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the exp of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes e to the power of this expression.
```typescript
// Compute e to the power of the 'value' field.
field("value").exp();
```
- A new representing the exp of the numeric value.
+
+## Expression.floor()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the floor of a numeric value.
Signature:
```typescript
-exp(): FunctionExpression;
+floor(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.floor()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the floor of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the floor of a numeric value.
```typescript
// Compute the floor of the 'price' field.
field("price").floor();
```
- A new representing the floor of the numeric value.
-
-Signature:
-
-```typescript
-floor(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
## Expression.greaterThan()
@@ -2043,12 +1554,6 @@ floor(): FunctionExpression;
Creates an expression that checks if this expression is greater than another expression.
-```typescript
-// Check if the 'age' field is greater than the 'limit' field
-field("age").greaterThan(field("limit"));
-
-```
-
Signature:
```typescript
@@ -2059,25 +1564,30 @@ greaterThan(expression: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for greater than. A new Expr representing the greater than comparison. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for greater than. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.greaterThan()
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is greater than a constant value.
```typescript
-// Check if the 'price' field is greater than 100
-field("price").greaterThan(100);
+// Check if the 'age' field is greater than the 'limit' field
+field("age").greaterThan(field("limit"));
```
+## Expression.greaterThan()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is greater than a constant value.
+
Signature:
```typescript
@@ -2088,25 +1598,30 @@ greaterThan(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for greater than. A new Expr representing the greater than comparison. |
+| value | unknown | The constant value to compare for greater than. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.greaterThanOrEqual()
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is greater than or equal to another expression.
```typescript
-// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1
-field("quantity").greaterThanOrEqual(field('requirement').add(1));
+// Check if the 'price' field is greater than 100
+field("price").greaterThan(100);
```
+## Expression.greaterThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is greater than or equal to another expression.
+
Signature:
```typescript
@@ -2117,25 +1632,30 @@ greaterThanOrEqual(expression: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for greater than or equal to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.greaterThanOrEqual()
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is greater than or equal to a constant value.
```typescript
-// Check if the 'score' field is greater than or equal to 80
-field("score").greaterThanOrEqual(80);
+// Check if the 'quantity' field is greater than or equal to field 'requirement' plus 1
+field("quantity").greaterThanOrEqual(field('requirement').add(1));
```
+## Expression.greaterThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is greater than or equal to a constant value.
+
Signature:
```typescript
@@ -2146,26 +1666,30 @@ greaterThanOrEqual(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for greater than or equal to. A new Expr representing the greater than or equal to comparison. |
+| value | unknown | The constant value to compare for greater than or equal to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.ifAbsent()
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `elseValue` argument if this expression results in an absent value, else return the result of the this expression evaluation.
```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-field("optional_field").ifAbsent("default_value")
+// Check if the 'score' field is greater than or equal to 80
+field("score").greaterThanOrEqual(80);
```
+## Expression.ifAbsent()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `elseValue` argument if this expression results in an absent value, else return the result of the this expression evaluation.
+
Signature:
```typescript
@@ -2176,12 +1700,24 @@ ifAbsent(elseValue: unknown): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| elseValue | unknown | The value that will be returned if this Expression evaluates to an absent value. A new \[Expression\] representing the ifAbsent operation. |
+| elseValue | unknown | The value that will be returned if this Expression evaluates to an absent value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new \[Expression\] representing the ifAbsent operation.
+
+### Example
+
+
+```typescript
+// Returns the value of the optional field 'optional_field', or returns 'default_value'
+// if the field is absent.
+field("optional_field").ifAbsent("default_value")
+
+```
+
## Expression.ifAbsent()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2206,12 +1742,14 @@ ifAbsent(elseExpression: unknown): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| elseExpression | unknown | The Expression that will be evaluated if this Expression evaluates to an absent value. A new \[Expression\] representing the ifAbsent operation. |
+| elseExpression | unknown | The Expression that will be evaluated if this Expression evaluates to an absent value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new \[Expression\] representing the ifAbsent operation.
+
## Expression.ifError()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2219,13 +1757,6 @@ ifAbsent(elseExpression: unknown): Expression;
Creates an expression that returns the result of the `catchExpr` argument if there is an error, else return the result of this expression.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// the entire title field if the array is empty or the field is another type.
-field("title").arrayGet(0).ifError(field("title"));
-
-```
-
Signature:
```typescript
@@ -2236,25 +1767,30 @@ ifError(catchExpr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The catch expression that will be evaluated and returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The catch expression that will be evaluated and returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.ifError()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
```typescript
// Returns the first item in the title field arrays, or returns
-// "Default Title"
-field("title").arrayGet(0).ifError("Default Title");
+// the entire title field if the array is empty or the field is another type.
+field("title").arrayGet(0).ifError(field("title"));
+
+```
+
+## Expression.ifError()
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `catch` argument if there is an error, else return the result of this expression.
Signature:
@@ -2266,25 +1802,30 @@ ifError(catchValue: unknown): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| catchValue | unknown | The value that will be returned if this expression produces an error. A new representing the 'ifError' operation. |
+| catchValue | unknown | The value that will be returned if this expression produces an error. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.isAbsent()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ifError' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns `true` if the result of this expression is absent. Otherwise, returns `false` even if the value is `null`.
```typescript
-// Check if the field `value` is absent.
-field("value").isAbsent();
+// Returns the first item in the title field arrays, or returns
+// "Default Title"
+field("title").arrayGet(0).ifError("Default Title");
```
- A new representing the 'isAbsent' check.
+
+## Expression.isAbsent()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns `true` if the result of this expression is absent. Otherwise, returns `false` even if the value is `null`.
Signature:
@@ -2295,19 +1836,24 @@ isAbsent(): BooleanExpression;
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.isError()
+A new [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) representing the 'isAbsent' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a given expression produces an error.
```typescript
-// Check if the result of a calculation is an error
-field("title").arrayContains(1).isError();
+// Check if the field `value` is absent.
+field("value").isAbsent();
+@example
```
- A new representing the 'isError' check.
+
+## Expression.isError()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a given expression produces an error.
Signature:
@@ -2318,19 +1864,24 @@ isError(): BooleanExpression;
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.join()
+A new [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) representing the 'isError' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-field("tags").join(field("separator"))
+// Check if the result of a calculation is an error
+field("title").arrayContains(1).isError();
```
+## Expression.join()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2341,25 +1892,30 @@ join(delimiterExpression: Expression): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| delimiterExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. A new Expression representing the join operation. |
+| delimiterExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
-## Expression.join()
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array field into a string.
```typescript
-// Join the elements of the 'tags' field with a comma and space.
-field("tags").join(", ")
+// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
+field("tags").join(field("separator"))
```
+## Expression.join()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array field into a string.
+
Signature:
```typescript
@@ -2370,28 +1926,29 @@ join(delimiter: string): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| delimiter | string | The string to use as a delimiter. A new Expression representing the join operation. |
+| delimiter | string | The string to use as a delimiter. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
-## Expression.length()
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string, array, map, vector, or bytes.
```typescript
-// Get the length of the 'name' field.
-field("name").length();
-
-// Get the number of items in the 'cart' array.
-field("cart").length();
+// Join the elements of the 'tags' field with a comma and space.
+field("tags").join(", ")
```
- A new `Expr` representing the length of the string, array, map, vector, or bytes.
+
+## Expression.length()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string, array, map, vector, or bytes.
Signature:
@@ -2402,19 +1959,27 @@ length(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.lessThan()
+A new `Expression` representing the length of the string, array, map, vector, or bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than another expression.
```typescript
-// Check if the 'age' field is less than 'limit'
-field("age").lessThan(field('limit'));
+// Get the length of the 'name' field.
+field("name").length();
+
+// Get the number of items in the 'cart' array.
+field("cart").length();
```
+## Expression.lessThan()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than another expression.
+
Signature:
```typescript
@@ -2425,25 +1990,30 @@ lessThan(experession: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| experession | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for less than. A new Expr representing the less than comparison. |
+| experession | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for less than. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.lessThan()
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than a constant value.
```typescript
-// Check if the 'price' field is less than 50
-field("price").lessThan(50);
+// Check if the 'age' field is less than 'limit'
+field("age").lessThan(field('limit'));
```
+## Expression.lessThan()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than a constant value.
+
Signature:
```typescript
@@ -2454,25 +2024,30 @@ lessThan(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for less than. A new Expr representing the less than comparison. |
+| value | unknown | The constant value to compare for less than. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.lessThanOrEqual()
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than or equal to another expression.
```typescript
-// Check if the 'quantity' field is less than or equal to 20
-field("quantity").lessThan(constant(20));
+// Check if the 'price' field is less than 50
+field("price").lessThan(50);
```
+## Expression.lessThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than or equal to another expression.
+
Signature:
```typescript
@@ -2483,25 +2058,30 @@ lessThanOrEqual(expression: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for less than or equal to. A new Expr representing the less than or equal to comparison. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for less than or equal to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.lessThanOrEqual()
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is less than or equal to a constant value.
```typescript
-// Check if the 'score' field is less than or equal to 70
-field("score").lessThan(70);
+// Check if the 'quantity' field is less than or equal to 20
+field("quantity").lessThan(constant(20));
```
+## Expression.lessThanOrEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is less than or equal to a constant value.
+
Signature:
```typescript
@@ -2512,25 +2092,30 @@ lessThanOrEqual(value: unknown): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | unknown | The constant value to compare for less than or equal to. A new Expr representing the less than or equal to comparison. |
+| value | unknown | The constant value to compare for less than or equal to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.like()
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive string comparison.
```typescript
-// Check if the 'title' field contains the word "guide" (case-sensitive)
-field("title").like("%guide%");
+// Check if the 'score' field is less than or equal to 70
+field("score").lessThan(70);
```
+## Expression.like()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive string comparison.
+
Signature:
```typescript
@@ -2541,18 +2126,16 @@ like(pattern: string): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. |
+| pattern | string | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.like()
+A new `Expression` representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive string comparison.
```typescript
// Check if the 'title' field contains the word "guide" (case-sensitive)
@@ -2560,6 +2143,13 @@ field("title").like("%guide%");
```
+## Expression.like()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive string comparison.
+
Signature:
```typescript
@@ -2570,25 +2160,29 @@ like(pattern: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. A new Expr representing the 'like' comparison. |
+| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.ln()
+A new `Expression` representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the natural logarithm of a numeric value.
```typescript
-// Compute the natural logarithm of the 'value' field.
-field("value").ln();
+// Check if the 'title' field contains the word "guide" (case-sensitive)
+field("title").like("%guide%");
```
- A new representing the natural logarithm of the numeric value.
+
+## Expression.ln()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the natural logarithm of a numeric value.
Signature:
@@ -2599,19 +2193,23 @@ ln(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.log10()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the natural logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the base-10 logarithm of a numeric value.
```typescript
-// Compute the base-10 logarithm of the 'value' field.
-field("value").log10();
+// Compute the natural logarithm of the 'value' field.
+field("value").ln();
```
- A new representing the base-10 logarithm of the numeric value.
+
+## Expression.log10()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the base-10 logarithm of a numeric value.
Signature:
@@ -2622,19 +2220,24 @@ log10(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.logicalMaximum()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the base-10 logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering.
```typescript
-// Returns the larger value between the 'timestamp' field and the current timestamp.
-field("timestamp").logicalMaximum(Function.currentTimestamp());
+// Compute the base-10 logarithm of the 'value' field.
+field("value").log10();
```
+## Expression.logicalMaximum()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the larger value between this expression and another expression, based on Firestore's value type ordering.
+
Signature:
```typescript
@@ -2646,25 +2249,30 @@ logicalMaximum(second: Expression | unknown, ...others: ArrayExpr representing the value associated with the given key in the map. |
+| subfield | string | The key to access in the map. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the value associated with the given key in the map.
+
+### Example
+
+
+```typescript
+// Get the 'city' value from the 'address' map field
+field("address").mapGet("city");
+
+```
+
## Expression.mapMerge()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2718,13 +2342,6 @@ mapGet(subfield: string): FunctionExpression;
Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-field('settings').mapMerge({ enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
-
Signature:
```typescript
@@ -2742,7 +2359,17 @@ mapMerge(secondMap: RecordExpr representing the modulo operation. |
+| value | number | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.mod()
+A new `Expression` representing the modulo operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the modulo (remainder) of dividing this expression by a constant value.
```typescript
// Calculate the remainder of dividing the 'value' field by 10
@@ -2894,28 +2562,33 @@ field("value").mod(10);
```
+## Expression.multiply()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that multiplies this expression by another expression.
+
Signature:
```typescript
-mod(value: number): FunctionExpression;
+multiply(second: Expression | number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| value | number | The constant value to divide by. A new Expr representing the modulo operation. |
+| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| number | The second expression or literal to multiply by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.multiply()
+A new `Expression` representing the multiplication operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that multiplies this expression by another expression.
```typescript
// Multiply the 'quantity' field by the 'price' field
@@ -2923,28 +2596,33 @@ field("quantity").multiply(field("price"));
```
+## Expression.notEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to another expression.
+
Signature:
```typescript
-multiply(second: Expression | number): FunctionExpression;
+notEqual(expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| number | The second expression or literal to multiply by. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for inequality. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqual()
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to another expression.
```typescript
// Check if the 'status' field is not equal to "completed"
@@ -2952,28 +2630,33 @@ field("status").notEqual("completed");
```
+## Expression.notEqual()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to a constant value.
+
Signature:
```typescript
-notEqual(expression: Expression): BooleanExpression;
+notEqual(value: unknown): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare for inequality. A new Expr representing the inequality comparison. |
+| value | unknown | The constant value to compare for inequality. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqual()
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to a constant value.
```typescript
// Check if the 'country' field is not equal to "USA"
@@ -2981,28 +2664,33 @@ field("country").notEqual("USA");
```
+## Expression.notEqualAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to any of the provided values or expressions.
+
Signature:
```typescript
-notEqual(value: unknown): BooleanExpression;
+notEqualAny(values: ArrayExpr representing the inequality comparison. |
+| values | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | The values or expressions to check against. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqualAny()
+A new `Expression` representing the 'notEqualAny' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to any of the provided values or expressions.
```typescript
// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
@@ -3010,28 +2698,33 @@ field("status").notEqualAny(["pending", field("rejectedStatus")]);
```
+## Expression.notEqualAny()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression.
+
Signature:
```typescript
-notEqualAny(values: ArrayExpr representing the 'notEqualAny' comparison. |
+| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The values or expressions to check against. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.notEqualAny()
+A new `Expression` representing the 'notEqualAny' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if this expression is not equal to any of the values in the evaluated expression.
```typescript
// Check if the 'status' field is not equal to any value in the field 'rejectedStatuses'
@@ -3039,28 +2732,33 @@ field("status").notEqualAny(field('rejectedStatuses'));
```
+## Expression.pow()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of this expression raised to the power of another expression.
+
Signature:
```typescript
-notEqualAny(arrayExpression: Expression): BooleanExpression;
+pow(exponent: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The values or expressions to check against. A new Expr representing the 'notEqualAny' comparison. |
+| exponent | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise this expression to the power of. |
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.pow()
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of this expression raised to the power of another expression.
```typescript
// Raise the value of the 'base' field to the power of the 'exponent' field.
@@ -3068,28 +2766,33 @@ field("base").pow(field("exponent"));
```
+## Expression.pow()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of this expression raised to the power of a constant value.
+
Signature:
```typescript
-pow(exponent: Expression): FunctionExpression;
+pow(exponent: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| exponent | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise this expression to the power of. A new Expr representing the power operation. |
+| exponent | number | The constant value to raise this expression to the power of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.pow()
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of this expression raised to the power of a constant value.
```typescript
// Raise the value of the 'base' field to the power of 2.
@@ -3097,57 +2800,67 @@ field("base").pow(2);
```
+## Expression.regexContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string contains a specified regular expression as a substring.
+
Signature:
```typescript
-pow(exponent: number): FunctionExpression;
+regexContains(pattern: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| exponent | number | The constant value to raise this expression to the power of. A new Expr representing the power operation. |
+| pattern | string | The regular expression to use for the search. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexContains()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string contains a specified regular expression as a substring.
```typescript
// Check if the 'description' field contains "example" (case-insensitive)
field("description").regexContains("(?i)example");
-```
+```
+
+## Expression.regexContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string contains a specified regular expression as a substring.
Signature:
```typescript
-regexContains(pattern: string): BooleanExpression;
+regexContains(pattern: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | string | The regular expression to use for the search. A new Expr representing the 'contains' comparison. |
+| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The regular expression to use for the search. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexContains()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string contains a specified regular expression as a substring.
```typescript
// Check if the 'description' field contains the regular expression stored in field 'regex'
@@ -3155,28 +2868,33 @@ field("description").regexContains(field("regex"));
```
+## Expression.regexMatch()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string matches a specified regular expression.
+
Signature:
```typescript
-regexContains(pattern: Expression): BooleanExpression;
+regexMatch(pattern: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The regular expression to use for the search. A new Expr representing the 'contains' comparison. |
+| pattern | string | The regular expression to use for the match. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexMatch()
+A new `Expression` representing the regular expression match.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string matches a specified regular expression.
```typescript
// Check if the 'email' field matches a valid email pattern
@@ -3184,28 +2902,33 @@ field("email").regexMatch("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
```
+## Expression.regexMatch()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string matches a specified regular expression.
+
Signature:
```typescript
-regexMatch(pattern: string): BooleanExpression;
+regexMatch(pattern: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| pattern | string | The regular expression to use for the match. A new Expr representing the regular expression match. |
+| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The regular expression to use for the match. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.regexMatch()
+A new `Expression` representing the regular expression match.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string matches a specified regular expression.
```typescript
// Check if the 'email' field matches a regular expression stored in field 'regex'
@@ -3213,67 +2936,59 @@ field("email").regexMatch(field("regex"));
```
-Signature:
+## Expression.reverse()
-```typescript
-regexMatch(pattern: Expression): BooleanExpression;
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-#### Parameters
+Creates an expression that reverses this string expression.
-| Parameter | Type | Description |
-| --- | --- | --- |
-| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The regular expression to use for the match. A new Expr representing the regular expression match. |
+Signature:
+```typescript
+reverse(): FunctionExpression;
+```
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.reverse()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses this string expression.
```typescript
// Reverse the value of the 'myString' field.
field("myString").reverse();
```
- A new representing the reversed string.
+
+## Expression.round()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the nearest whole number.
Signature:
```typescript
-reverse(): FunctionExpression;
+round(): FunctionExpression;
```
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.round()
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the nearest whole number.
```typescript
// Round the value of the 'price' field.
field("price").round();
```
- A new `Expr` representing the rounded value.
-
-Signature:
-
-```typescript
-round(): FunctionExpression;
-```
-Returns:
-
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
## Expression.round()
@@ -3282,12 +2997,6 @@ round(): FunctionExpression;
Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-field("price").round(2);
-
-```
-
Signature:
```typescript
@@ -3298,25 +3007,30 @@ round(decimalPlaces: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| decimalPlaces | number | A constant specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | number | A constant specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.round()
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the specified number of decimal places.
```typescript
// Round the value of the 'price' field to two decimal places.
-field("price").round(constant(2));
+field("price").round(2);
```
+## Expression.round()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the specified number of decimal places.
+
Signature:
```typescript
@@ -3327,12 +3041,23 @@ round(decimalPlaces: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| decimalPlaces | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the rounded value.
+
+### Example
+
+
+```typescript
+// Round the value of the 'price' field to two decimal places.
+field("price").round(constant(2));
+
+```
+
## Expression.split()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3356,6 +3081,8 @@ split(delimiter: string): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3364,7 +3091,6 @@ split(delimiter: string): FunctionExpression;
field('scoresCsv').split(',')
```
- A new representing the split function.
## Expression.split()
@@ -3389,6 +3115,8 @@ split(delimiter: Expression): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3397,7 +3125,6 @@ split(delimiter: Expression): FunctionExpression;
field('scores').split(conditional(field('format').equal('csv'), constant(','), constant(':'))
```
- A new representing the split function.
## Expression.sqrt()
@@ -3406,13 +3133,6 @@ field('scores').split(conditional(field('format').equal('csv'), constant(','), c
Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-field("value").sqrt();
-
-```
- A new representing the square root of the numeric value.
-
Signature:
```typescript
@@ -3422,19 +3142,24 @@ sqrt(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.startsWith()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the square root of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string starts with a given prefix.
```typescript
-// Check if the 'name' field starts with "Mr."
-field("name").startsWith("Mr.");
+// Compute the square root of the 'value' field.
+field("value").sqrt();
```
+## Expression.startsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string starts with a given prefix.
+
Signature:
```typescript
@@ -3445,25 +3170,30 @@ startsWith(prefix: string): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| prefix | string | The prefix to check for. A new Expr representing the 'starts with' comparison. |
+| prefix | string | The prefix to check for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.startsWith()
+A new `Expression` representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string starts with a given prefix (represented as an expression).
```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-field("fullName").startsWith(field("firstName"));
+// Check if the 'name' field starts with "Mr."
+field("name").startsWith("Mr.");
```
+## Expression.startsWith()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string starts with a given prefix (represented as an expression).
+
Signature:
```typescript
@@ -3474,25 +3204,30 @@ startsWith(prefix: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| prefix | [Expression](./firestore_pipelines.expression.md#expression_class) | The prefix expression to check for. A new Expr representing the 'starts with' comparison. |
+| prefix | [Expression](./firestore_pipelines.expression.md#expression_class) | The prefix expression to check for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.stringConcat()
+A new `Expression` representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that concatenates string expressions together.
```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-field("firstName").stringConcat(constant(" "), field("lastName"));
+// Check if the 'fullName' field starts with the value of the 'firstName' field
+field("fullName").startsWith(field("firstName"));
```
+## Expression.stringConcat()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates string expressions together.
+
Signature:
```typescript
@@ -3504,25 +3239,30 @@ stringConcat(secondString: Expression | string, ...otherStrings: ArrayExpr representing the 'contains' comparison. |
+| substring | string | The substring to search for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.stringContains()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string contains the string represented by another expression.
```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-field("description").stringContains(field("keyword"));
+// Check if the 'description' field contains "example".
+field("description").stringContains("example");
```
+## Expression.stringContains()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string contains the string represented by another expression.
+
Signature:
```typescript
@@ -3562,25 +3307,29 @@ stringContains(expr: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the substring to search for. A new Expr representing the 'contains' comparison. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the substring to search for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-## Expression.stringReverse()
+A new `Expression` representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses a string.
```typescript
-// Reverse the value of the 'myString' field.
-field("myString").stringReverse();
+// Check if the 'description' field contains the value of the 'keyword' field.
+field("description").stringContains(field("keyword"));
```
- A new representing the reversed string.
+
+## Expression.stringReverse()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses a string.
Signature:
@@ -3591,6 +3340,17 @@ stringReverse(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
+
+### Example
+
+
+```typescript
+// Reverse the value of the 'myString' field.
+field("myString").stringReverse();
+
+```
+
## Expression.substring()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3646,12 +3406,6 @@ substring(position: Expression, length?: Expression): FunctionExpression;
Creates an expression that subtracts another expression from this expression.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-field("price").subtract(field("discount"));
-
-```
-
Signature:
```typescript
@@ -3662,25 +3416,30 @@ subtract(subtrahend: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| subtrahend | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract from this expression. A new Expr representing the subtraction operation. |
+| subtrahend | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract from this expression. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.subtract()
+A new `Expression` representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a constant value from this expression.
```typescript
-// Subtract 20 from the value of the 'total' field
-field("total").subtract(20);
+// Subtract the 'discount' field from the 'price' field
+field("price").subtract(field("discount"));
```
+## Expression.subtract()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a constant value from this expression.
+
Signature:
```typescript
@@ -3691,11 +3450,22 @@ subtract(subtrahend: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| subtrahend | number | The constant value to subtract. A new Expr representing the subtraction operation. |
+| subtrahend | number | The constant value to subtract. |
+
+Returns:
+
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new `Expression` representing the subtraction operation.
+
+### Example
-Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+```typescript
+// Subtract 20 from the value of the 'total' field
+field("total").subtract(20);
+
+```
## Expression.sum()
@@ -3704,13 +3474,6 @@ subtract(subtrahend: number): FunctionExpression;
Creates an aggregation that calculates the sum of a numeric field across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-field("orderAmount").sum().as("totalRevenue");
-
-```
- A new `AggregateFunction` representing the 'sum' aggregation.
-
Signature:
```typescript
@@ -3720,19 +3483,24 @@ sum(): AggregateFunction;
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-## Expression.timestampAdd()
+A new `AggregateFunction` representing the 'sum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds a specified amount of time to this timestamp expression.
```typescript
-// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
-field("timestamp").timestampAdd(field("unit"), field("amount"));
+// Calculate the total revenue from a set of orders
+field("orderAmount").sum().as("totalRevenue");
```
+## Expression.timestampAdd()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds a specified amount of time to this timestamp expression.
+
Signature:
```typescript
@@ -3744,25 +3512,30 @@ timestampAdd(unit: Expression, amount: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| unit | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. |
-| amount | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. |
+| amount | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampAdd()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds a specified amount of time to this timestamp expression.
```typescript
-// Add 1 day to the 'timestamp' field.
-field("timestamp").timestampAdd("day", 1);
+// Add some duration determined by field 'unit' and 'amount' to the 'timestamp' field.
+field("timestamp").timestampAdd(field("unit"), field("amount"));
```
+## Expression.timestampAdd()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds a specified amount of time to this timestamp expression.
+
Signature:
```typescript
@@ -3774,25 +3547,30 @@ timestampAdd(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour'
| Parameter | Type | Description |
| --- | --- | --- |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). |
-| amount | number | The amount of time to add. A new representing the resulting timestamp. |
+| amount | number | The amount of time to add. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampSubtract()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a specified amount of time from this timestamp expression.
```typescript
-// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
-field("timestamp").timestampSubtract(field("unit"), field("amount"));
+// Add 1 day to the 'timestamp' field.
+field("timestamp").timestampAdd("day", 1);
```
+## Expression.timestampSubtract()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a specified amount of time from this timestamp expression.
+
Signature:
```typescript
@@ -3804,25 +3582,30 @@ timestampSubtract(unit: Expression, amount: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| unit | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression evaluates to unit of time, must be one of 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day'. |
-| amount | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. A new representing the resulting timestamp. |
+| amount | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression evaluates to amount of the unit. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampSubtract()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a specified amount of time from this timestamp expression.
```typescript
-// Subtract 1 day from the 'timestamp' field.
-field("timestamp").timestampSubtract("day", 1);
+// Subtract some duration determined by field 'unit' and 'amount' from the 'timestamp' field.
+field("timestamp").timestampSubtract(field("unit"), field("amount"));
```
+## Expression.timestampSubtract()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a specified amount of time from this timestamp expression.
+
Signature:
```typescript
@@ -3834,25 +3617,29 @@ timestampSubtract(unit: 'microsecond' | 'millisecond' | 'second' | 'minute' | 'h
| Parameter | Type | Description |
| --- | --- | --- |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). |
-| amount | number | The amount of time to subtract. A new representing the resulting timestamp. |
+| amount | number | The amount of time to subtract. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampToUnixMicros()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-field("timestamp").timestampToUnixMicros();
+// Subtract 1 day from the 'timestamp' field.
+field("timestamp").timestampSubtract("day", 1);
```
- A new representing the number of microseconds since epoch.
+
+## Expression.timestampToUnixMicros()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts this timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
Signature:
@@ -3863,19 +3650,23 @@ timestampToUnixMicros(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampToUnixMillis()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of microseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-field("timestamp").timestampToUnixMillis();
+// Convert the 'timestamp' field to microseconds since epoch.
+field("timestamp").timestampToUnixMicros();
```
- A new representing the number of milliseconds since epoch.
+
+## Expression.timestampToUnixMillis()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts this timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
Signature:
@@ -3886,19 +3677,23 @@ timestampToUnixMillis(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.timestampToUnixSeconds()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of milliseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-field("timestamp").timestampToUnixSeconds();
+// Convert the 'timestamp' field to milliseconds since epoch.
+field("timestamp").timestampToUnixMillis();
```
- A new representing the number of seconds since epoch.
+
+## Expression.timestampToUnixSeconds()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts this timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
Signature:
@@ -3909,6 +3704,17 @@ timestampToUnixSeconds(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of seconds since epoch.
+
+### Example
+
+
+```typescript
+// Convert the 'timestamp' field to seconds since epoch.
+field("timestamp").timestampToUnixSeconds();
+
+```
+
## Expression.timestampTruncate()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3927,12 +3733,14 @@ timestampTruncate(granularity: TimeGranularity, timezone?: string | Expression):
| Parameter | Type | Description |
| --- | --- | --- |
| granularity | [TimeGranularity](./firestore_pipelines.md#timegranularity) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -3960,12 +3768,14 @@ timestampTruncate(granularity: Expression, timezone?: string | Expression): Func
| Parameter | Type | Description |
| --- | --- | --- |
| granularity | [Expression](./firestore_pipelines.expression.md#expression_class) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -3982,13 +3792,6 @@ field('createdAt').timestampTruncate(field('granularity'))
Creates an expression that converts a string to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-field("name").toLower();
-
-```
- A new `Expr` representing the lowercase string.
-
Signature:
```typescript
@@ -3998,19 +3801,23 @@ toLower(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.toUpper()
+A new `Expression` representing the lowercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a string to uppercase.
```typescript
-// Convert the 'title' field to uppercase
-field("title").toUpper();
+// Convert the 'name' field to lowercase
+field("name").toLower();
```
- A new `Expr` representing the uppercase string.
+
+## Expression.toUpper()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a string to uppercase.
Signature:
@@ -4021,22 +3828,24 @@ toUpper(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.trim()
+A new `Expression` representing the uppercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that removes leading and trailing characters from a string or byte array.
```typescript
-// Trim whitespace from the 'userInput' field
-field("userInput").trim();
-
-// Trim quotes from the 'userInput' field
-field("userInput").trim('"');
+// Convert the 'title' field to uppercase
+field("title").toUpper();
```
+## Expression.trim()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that removes leading and trailing characters from a string or byte array.
+
Signature:
```typescript
@@ -4047,12 +3856,26 @@ trim(valueToTrim?: string | Expression | Bytes): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| valueToTrim | string \| [Expression](./firestore_pipelines.expression.md#expression_class) \| [Bytes](./firestore_.bytes.md#bytes_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. A new Expr representing the trimmed string or byte array. |
+| valueToTrim | string \| [Expression](./firestore_pipelines.expression.md#expression_class) \| [Bytes](./firestore_.bytes.md#bytes_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the trimmed string or byte array.
+
+### Example
+
+
+```typescript
+// Trim whitespace from the 'userInput' field
+field("userInput").trim();
+
+// Trim quotes from the 'userInput' field
+field("userInput").trim('"');
+
+```
+
## Expression.type()
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -4069,6 +3892,8 @@ type(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the data type.
+
### Example
@@ -4077,7 +3902,6 @@ type(): FunctionExpression;
field('title').type()
```
- A new {Expression} representing the data type.
## Expression.unixMicrosToTimestamp()
@@ -4086,13 +3910,6 @@ field('title').type()
Creates an expression that interprets this expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-field("microseconds").unixMicrosToTimestamp();
-
-```
- A new representing the timestamp.
-
Signature:
```typescript
@@ -4102,19 +3919,23 @@ unixMicrosToTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.unixMillisToTimestamp()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-field("milliseconds").unixMillisToTimestamp();
+// Interpret the 'microseconds' field as microseconds since epoch.
+field("microseconds").unixMicrosToTimestamp();
```
- A new representing the timestamp.
+
+## Expression.unixMillisToTimestamp()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets this expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
Signature:
@@ -4125,19 +3946,23 @@ unixMillisToTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.unixSecondsToTimestamp()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-field("seconds").unixSecondsToTimestamp();
+// Interpret the 'milliseconds' field as milliseconds since epoch.
+field("milliseconds").unixMillisToTimestamp();
```
- A new representing the timestamp.
+
+## Expression.unixSecondsToTimestamp()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets this expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
Signature:
@@ -4148,19 +3973,23 @@ unixSecondsToTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-## Expression.vectorLength()
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression.
```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-field("embedding").vectorLength();
+// Interpret the 'seconds' field as seconds since epoch.
+field("seconds").unixSecondsToTimestamp();
```
- A new representing the length of the vector.
+
+## Expression.vectorLength()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length (number of dimensions) of this Firestore Vector expression.
Signature:
@@ -4171,3 +4000,14 @@ vectorLength(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the vector.
+
+### Example
+
+
+```typescript
+// Get the vector length (dimension) of the field 'embedding'.
+field("embedding").vectorLength();
+
+```
+
diff --git a/docs-devsite/firestore_pipelines.field.md b/docs-devsite/firestore_pipelines.field.md
index de4e5fb7b2..3a0a4aa75b 100644
--- a/docs-devsite/firestore_pipelines.field.md
+++ b/docs-devsite/firestore_pipelines.field.md
@@ -13,21 +13,12 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Represents a reference to a field in a Firestore document, or outputs of a stage.
+Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) stage.
true if a field is absent. Otherwise, returns false even if the field value is null.
-```typescript
-// Check if the field `value` is absent.
-isAbsent("value");
-
-```
- |
-| [reverse(field)](./firestore_pipelines.md#reverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field.
-```typescript
-// Reverse the value of the 'myString' field.
-reverse("myString");
-
-```
- |
-| [stringReverse(field)](./firestore_pipelines.md#stringreverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field.
-```typescript
-// Reverse the value of the 'myString' field.
-strReverse("myString");
-
-```
- |
+| [isAbsent(field)](./firestore_pipelines.md#isabsent_0fb8cd4) | (Public Preview) Creates an expression that returns true if a field is absent. Otherwise, returns false even if the field value is null. |
+| [reverse(field)](./firestore_pipelines.md#reverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field. |
+| [stringReverse(field)](./firestore_pipelines.md#stringreverse_0fb8cd4) | (Public Preview) Creates an expression that reverses a string value in the specified field. |
| [substring(field, position, length)](./firestore_pipelines.md#substring_0d9573a) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
| [substring(field, position, length)](./firestore_pipelines.md#substring_05cb14e) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
| function(fieldName, ...) |
| [abs(fieldName)](./firestore_pipelines.md#abs_e5b0480) | (Public Preview) Creates an expression that computes the absolute value of a numeric value. |
-| [add(fieldName, second)](./firestore_pipelines.md#add_b75bb8b) | (Public Preview) Creates an expression that adds a field's value to an expression.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add("quantity", field("reserve"));
-
-```
- |
-| [arrayContains(fieldName, element)](./firestore_pipelines.md#arraycontains_aaace4a) | (Public Preview) Creates an expression that checks if a field's array value contains a specific element.
-```typescript
-// Check if the 'colors' array contains the value of field 'selectedColor'
-arrayContains("colors", field("selectedColor"));
-
-```
- |
-| [arrayContains(fieldName, element)](./firestore_pipelines.md#arraycontains_999590f) | (Public Preview) Creates an expression that checks if a field's array value contains a specific value.
-```typescript
-// Check if the 'colors' array contains "red"
-arrayContains("colors", "red");
-
-```
- |
-| [arrayContainsAll(fieldName, values)](./firestore_pipelines.md#arraycontainsall_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions.
-```typescript
-// Check if the 'tags' array contains both of the values from field 'tag1', the value "SciFi", and "Adventure"
-arrayContainsAll("tags", [field("tag1"), "SciFi", "Adventure"]);
-
-```
- |
-| [arrayContainsAll(fieldName, arrayExpression)](./firestore_pipelines.md#arraycontainsall_48da8d9) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions.
-```typescript
-// Check if the 'tags' array contains both of the values from field 'tag1', the value "SciFi", and "Adventure"
-arrayContainsAll("tags", [field("tag1"), "SciFi", "Adventure"]);
-
-```
- |
-| [arrayContainsAny(fieldName, values)](./firestore_pipelines.md#arraycontainsany_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements.
-```typescript
-// Check if the 'groups' array contains either the value from the 'userGroup' field
-// or the value "guest"
-arrayContainsAny("categories", [field("cate1"), "Science"]);
-
-```
- |
-| [arrayContainsAny(fieldName, values)](./firestore_pipelines.md#arraycontainsany_1b4f7cd) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements.
-```typescript
-// Check if the 'groups' array contains either the value from the 'userGroup' field
-// or the value "guest"
-arrayContainsAny("categories", array([field("cate1"), "Science"]));
-
-```
- |
-| [arrayLength(fieldName)](./firestore_pipelines.md#arraylength_e5b0480) | (Public Preview) Creates an expression that calculates the length of an array in a specified field.
-```typescript
-// Get the number of items in field 'cart'
-arrayLength('cart');
-
-```
- |
-| [arraySum(fieldName)](./firestore_pipelines.md#arraysum_e5b0480) | (Public Preview) Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-arraySum("scores");
-
-```
- |
-| [ascending(fieldName)](./firestore_pipelines.md#ascending_e5b0480) | (Public Preview) Creates an that sorts documents in ascending order based on a field.
-```typescript
-// Sort documents by the 'name' field in ascending order
-firestore.pipeline().collection("users")
- .sort(ascending("name"));
-
-```
- |
-| [average(fieldName)](./firestore_pipelines.md#average_e5b0480) | (Public Preview) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs.
-```typescript
-// Calculate the average age of users
-average("age").as("averageAge");
-
-```
- |
-| [byteLength(fieldName)](./firestore_pipelines.md#bytelength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.
-```typescript
-// Calculate the length of the 'myString' field in bytes.
-byteLength("myString");
-
-```
- |
-| [ceil(fieldName)](./firestore_pipelines.md#ceil_e5b0480) | (Public Preview) Creates an expression that computes the ceiling of a numeric value.
-```typescript
-// Compute the ceiling of the 'price' field.
-ceil("price");
-
-```
- |
-| [charLength(fieldName)](./firestore_pipelines.md#charlength_e5b0480) | (Public Preview) Creates an expression that calculates the character length of a string field in UTF8.
-```typescript
-// Get the character length of the 'name' field in UTF-8.
-strLength("name");
-
-```
- |
-| [collectionId(fieldName)](./firestore_pipelines.md#collectionid_e5b0480) | (Public Preview) Creates an expression that returns the collection ID from a path.
-```typescript
-// Get the collection ID from a path.
-collectionId("__name__");
-
-```
- |
-| [concat(fieldName, second, others)](./firestore_pipelines.md#concat_828272e) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
-```typescript
-// Concatenate a field with a literal string.
-concat(field("firstName"), "Doe")
-
-```
- |
-| [cosineDistance(fieldName, vector)](./firestore_pipelines.md#cosinedistance_463a23e) | (Public Preview) Calculates the Cosine distance between a field's vector value and a literal vector value.
-```typescript
-// Calculate the Cosine distance between the 'location' field and a target location
-cosineDistance("location", [37.7749, -122.4194]);
-
-```
- |
-| [cosineDistance(fieldName, vectorExpression)](./firestore_pipelines.md#cosinedistance_ed766a1) | (Public Preview) Calculates the Cosine distance between a field's vector value and a vector expression.
-```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-cosineDistance("userVector", field("itemVector"));
-
-```
- |
-| [count(fieldName)](./firestore_pipelines.md#count_e5b0480) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the input field exists.
-```typescript
-// Count the total number of products
-count("productId").as("totalProducts");
-
-```
- |
-| [descending(fieldName)](./firestore_pipelines.md#descending_e5b0480) | (Public Preview) Creates an that sorts documents in descending order based on a field.
-```typescript
-// Sort documents by the 'name' field in descending order
-firestore.pipeline().collection("users")
- .sort(descending("name"));
-
-```
- |
-| [divide(fieldName, expressions)](./firestore_pipelines.md#divide_cf36e43) | (Public Preview) Creates an expression that divides a field's value by an expression.
-```typescript
-// Divide the 'total' field by the 'count' field
-divide("total", field("count"));
-
-```
- |
-| [divide(fieldName, value)](./firestore_pipelines.md#divide_65e2f32) | (Public Preview) Creates an expression that divides a field's value by a constant value.
-```typescript
-// Divide the 'value' field by 10
-divide("value", 10);
-
-```
- |
-| [dotProduct(fieldName, vector)](./firestore_pipelines.md#dotproduct_463a23e) | (Public Preview) Calculates the dot product between a field's vector value and a double array.
-```typescript
-// Calculate the dot product distance between a feature vector and a target vector
-dotProduct("features", [0.5, 0.8, 0.2]);
-
-```
- |
-| [dotProduct(fieldName, vectorExpression)](./firestore_pipelines.md#dotproduct_ed766a1) | (Public Preview) Calculates the dot product between a field's vector value and a vector expression.
-```typescript
-// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2'
-dotProduct("docVector1", field("docVector2"));
-
-```
- |
-| [endsWith(fieldName, suffix)](./firestore_pipelines.md#endswith_05ca3b0) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix.
-```typescript
-// Check if the 'filename' field ends with ".txt"
-endsWith("filename", ".txt");
-
-```
- |
-| [endsWith(fieldName, suffix)](./firestore_pipelines.md#endswith_8fc0ebc) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix.
-```typescript
-// Check if the 'url' field ends with the value of the 'extension' field
-endsWith("url", field("extension"));
-
-```
- |
-| [equal(fieldName, expression)](./firestore_pipelines.md#equal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is equal to an expression.
-```typescript
-// Check if the 'age' field is equal to the 'limit' field
-equal("age", field("limit"));
-
-```
- |
-| [equal(fieldName, value)](./firestore_pipelines.md#equal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is equal to a constant value.
-```typescript
-// Check if the 'city' field is equal to string constant "London"
-equal("city", "London");
-
-```
- |
-| [equalAny(fieldName, values)](./firestore_pipelines.md#equalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny("category", [constant("Electronics"), field("primaryType")]);
-
-```
- |
-| [equalAny(fieldName, arrayExpression)](./firestore_pipelines.md#equalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
-```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny("category", ["Electronics", field("primaryType")]);
-
-```
- |
-| [euclideanDistance(fieldName, vector)](./firestore_pipelines.md#euclideandistance_463a23e) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a double array.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-euclideanDistance("location", [37.7749, -122.4194]);
-
-```
- |
-| [euclideanDistance(fieldName, vectorExpression)](./firestore_pipelines.md#euclideandistance_ed766a1) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a vector expression.
-```typescript
-// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
-euclideanDistance("pointA", field("pointB"));
-
-```
- |
-| [exists(fieldName)](./firestore_pipelines.md#exists_e5b0480) | (Public Preview) Creates an expression that checks if a field exists.
-```typescript
-// Check if the document has a field named "phoneNumber"
-exists("phoneNumber");
-
-```
- |
-| [exp(fieldName)](./firestore_pipelines.md#exp_e5b0480) | (Public Preview) Creates an expression that computes e to the power of the expression's result.
-```typescript
-// Compute e to the power of the 'value' field.
-exp('value');
-
-```
- A new representing the exp of the numeric value. |
+| [add(fieldName, second)](./firestore_pipelines.md#add_b75bb8b) | (Public Preview) Creates an expression that adds a field's value to an expression. |
+| [arrayContains(fieldName, element)](./firestore_pipelines.md#arraycontains_aaace4a) | (Public Preview) Creates an expression that checks if a field's array value contains a specific element. |
+| [arrayContains(fieldName, element)](./firestore_pipelines.md#arraycontains_999590f) | (Public Preview) Creates an expression that checks if a field's array value contains a specific value. |
+| [arrayContainsAll(fieldName, values)](./firestore_pipelines.md#arraycontainsall_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions. |
+| [arrayContainsAll(fieldName, arrayExpression)](./firestore_pipelines.md#arraycontainsall_48da8d9) | (Public Preview) Creates an expression that checks if a field's array value contains all the specified values or expressions. |
+| [arrayContainsAny(fieldName, values)](./firestore_pipelines.md#arraycontainsany_8060b23) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements. |
+| [arrayContainsAny(fieldName, values)](./firestore_pipelines.md#arraycontainsany_1b4f7cd) | (Public Preview) Creates an expression that checks if a field's array value contains any of the specified elements. |
+| [arrayLength(fieldName)](./firestore_pipelines.md#arraylength_e5b0480) | (Public Preview) Creates an expression that calculates the length of an array in a specified field. |
+| [arraySum(fieldName)](./firestore_pipelines.md#arraysum_e5b0480) | (Public Preview) Creates an expression that computes the sum of the elements in an array. |
+| [ascending(fieldName)](./firestore_pipelines.md#ascending_e5b0480) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in ascending order based on a field. |
+| [average(fieldName)](./firestore_pipelines.md#average_e5b0480) | (Public Preview) Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs. |
+| [byteLength(fieldName)](./firestore_pipelines.md#bytelength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob. |
+| [ceil(fieldName)](./firestore_pipelines.md#ceil_e5b0480) | (Public Preview) Creates an expression that computes the ceiling of a numeric value. |
+| [charLength(fieldName)](./firestore_pipelines.md#charlength_e5b0480) | (Public Preview) Creates an expression that calculates the character length of a string field in UTF8. |
+| [collectionId(fieldName)](./firestore_pipelines.md#collectionid_e5b0480) | (Public Preview) Creates an expression that returns the collection ID from a path. |
+| [concat(fieldName, second, others)](./firestore_pipelines.md#concat_828272e) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed. |
+| [cosineDistance(fieldName, vector)](./firestore_pipelines.md#cosinedistance_463a23e) | (Public Preview) Calculates the Cosine distance between a field's vector value and a literal vector value. |
+| [cosineDistance(fieldName, vectorExpression)](./firestore_pipelines.md#cosinedistance_ed766a1) | (Public Preview) Calculates the Cosine distance between a field's vector value and a vector expression. |
+| [count(fieldName)](./firestore_pipelines.md#count_e5b0480) | (Public Preview) Creates an aggregation that counts the number of stage inputs where the input field exists. |
+| [descending(fieldName)](./firestore_pipelines.md#descending_e5b0480) | (Public Preview) Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on a field. |
+| [divide(fieldName, expressions)](./firestore_pipelines.md#divide_cf36e43) | (Public Preview) Creates an expression that divides a field's value by an expression. |
+| [divide(fieldName, value)](./firestore_pipelines.md#divide_65e2f32) | (Public Preview) Creates an expression that divides a field's value by a constant value. |
+| [dotProduct(fieldName, vector)](./firestore_pipelines.md#dotproduct_463a23e) | (Public Preview) Calculates the dot product between a field's vector value and a double array. |
+| [dotProduct(fieldName, vectorExpression)](./firestore_pipelines.md#dotproduct_ed766a1) | (Public Preview) Calculates the dot product between a field's vector value and a vector expression. |
+| [endsWith(fieldName, suffix)](./firestore_pipelines.md#endswith_05ca3b0) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix. |
+| [endsWith(fieldName, suffix)](./firestore_pipelines.md#endswith_8fc0ebc) | (Public Preview) Creates an expression that checks if a field's value ends with a given postfix. |
+| [equal(fieldName, expression)](./firestore_pipelines.md#equal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is equal to an expression. |
+| [equal(fieldName, value)](./firestore_pipelines.md#equal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is equal to a constant value. |
+| [equalAny(fieldName, values)](./firestore_pipelines.md#equalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. |
+| [equalAny(fieldName, arrayExpression)](./firestore_pipelines.md#equalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is equal to any of the provided values or expressions. |
+| [euclideanDistance(fieldName, vector)](./firestore_pipelines.md#euclideandistance_463a23e) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a double array. |
+| [euclideanDistance(fieldName, vectorExpression)](./firestore_pipelines.md#euclideandistance_ed766a1) | (Public Preview) Calculates the Euclidean distance between a field's vector value and a vector expression. |
+| [exists(fieldName)](./firestore_pipelines.md#exists_e5b0480) | (Public Preview) Creates an expression that checks if a field exists. |
+| [exp(fieldName)](./firestore_pipelines.md#exp_e5b0480) | (Public Preview) Creates an expression that computes e to the power of the expression's result. |
| [floor(fieldName)](./firestore_pipelines.md#floor_e5b0480) | (Public Preview) Creates an expression that computes the floor of a numeric value. |
-| [greaterThan(fieldName, expression)](./firestore_pipelines.md#greaterthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is greater than an expression.
-```typescript
-// Check if the value of field 'age' is greater than the value of field 'limit'
-greaterThan("age", field("limit"));
-
-```
- |
-| [greaterThan(fieldName, value)](./firestore_pipelines.md#greaterthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than a constant value.
-```typescript
-// Check if the 'price' field is greater than 100
-greaterThan("price", 100);
-
-```
- |
-| [greaterThanOrEqual(fieldName, value)](./firestore_pipelines.md#greaterthanorequal_2e16acb) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to an expression.
-```typescript
-// Check if the value of field 'age' is greater than or equal to the value of field 'limit'
-greaterThanOrEqual("age", field("limit"));
-
-```
- |
-| [greaterThanOrEqual(fieldName, value)](./firestore_pipelines.md#greaterthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to a constant value.
-```typescript
-// Check if the 'score' field is greater than or equal to 80
-greaterThanOrEqual("score", 80);
-
-```
- |
-| [length\_2(fieldName)](./firestore_pipelines.md#length_2_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes.
-```typescript
-// Get the length of the 'name' field.
-length("name");
-
-// Get the number of items in the 'cart' array.
-length("cart");
-
-```
- |
-| [lessThan(fieldName, expression)](./firestore_pipelines.md#lessthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than an expression.
-```typescript
-// Check if the 'age' field is less than the 'limit' field
-lessThan("age", field("limit"));
-
-```
- |
-| [lessThan(fieldName, value)](./firestore_pipelines.md#lessthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than a constant value.
-```typescript
-// Check if the 'price' field is less than 50
-lessThan("price", 50);
-
-```
- |
-| [lessThanOrEqual(fieldName, expression)](./firestore_pipelines.md#lessthanorequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to an expression.
-```typescript
-// Check if the 'quantity' field is less than or equal to the 'limit' field
-lessThan("quantity", field("limit"));
-
-```
- |
-| [lessThanOrEqual(fieldName, value)](./firestore_pipelines.md#lessthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to a constant value.
-```typescript
-// Check if the 'score' field is less than or equal to 70
-lessThan("score", 70);
-
-```
- |
-| [like(fieldName, pattern)](./firestore_pipelines.md#like_67f7432) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like("title", "%guide%");
-
-```
- |
-| [like(fieldName, pattern)](./firestore_pipelines.md#like_cb1318d) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field.
-```typescript
-// Check if the 'title' field contains the string "guide"
-like("title", field("pattern"));
-
-```
- |
-| [ln(fieldName)](./firestore_pipelines.md#ln_e5b0480) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value.
-```typescript
-// Compute the natural logarithm of the 'value' field.
-ln("value");
-
-```
- |
-| [log(fieldName, base)](./firestore_pipelines.md#log_a89e21b) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with base 10.
-log("value", 10);
-
-```
- |
-| [log(fieldName, base)](./firestore_pipelines.md#log_805b11f) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base.
-```typescript
-// Compute the logarithm of the 'value' field with the base in the 'base' field.
-log("value", field("base"));
-
-```
- |
-| [log10(fieldName)](./firestore_pipelines.md#log10_e5b0480) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value.
-```typescript
-// Compute the base-10 logarithm of the 'value' field.
-log10("value");
-
-```
- |
-| [logicalMaximum(fieldName, second, others)](./firestore_pipelines.md#logicalmaximum_828272e) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the largest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMaximum("field1", field("field2"), 1000);
-
-```
- |
-| [logicalMinimum(fieldName, second, others)](./firestore_pipelines.md#logicalminimum_828272e) | (Public Preview) Creates an expression that returns the smallest value between a field's value and other input expressions or literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the smallest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMinimum("field1", field("field2"), 1000);
-
-```
- |
-| [mapGet(fieldName, subField)](./firestore_pipelines.md#mapget_06663cf) | (Public Preview) Accesses a value from a map (object) field using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-mapGet("address", "city");
-
-```
- |
-| [maximum(fieldName)](./firestore_pipelines.md#maximum_e5b0480) | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-maximum("score").as("highestScore");
-
-```
- |
-| [minimum(fieldName)](./firestore_pipelines.md#minimum_e5b0480) | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs.
-```typescript
-// Find the lowest price of all products
-minimum("price").as("lowestPrice");
-
-```
- |
-| [mod(fieldName, expression)](./firestore_pipelines.md#mod_1e91657) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression.
-```typescript
-// Calculate the remainder of dividing 'field1' by 'field2'.
-mod("field1", field("field2"));
-
-```
- |
-| [mod(fieldName, value)](./firestore_pipelines.md#mod_65e2f32) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant.
-```typescript
-// Calculate the remainder of dividing 'field1' by 5.
-mod("field1", 5);
-
-```
- |
-| [multiply(fieldName, second)](./firestore_pipelines.md#multiply_b75bb8b) | (Public Preview) Creates an expression that multiplies a field's value by an expression.
-```typescript
-// Multiply the 'quantity' field by the 'price' field
-multiply("quantity", field("price"));
-
-```
- |
-| [notEqual(fieldName, expression)](./firestore_pipelines.md#notequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is not equal to an expression.
-```typescript
-// Check if the 'status' field is not equal to the value of 'expectedStatus'
-notEqual("status", field("expectedStatus"));
-
-```
- |
-| [notEqual(fieldName, value)](./firestore_pipelines.md#notequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is not equal to a constant value.
-```typescript
-// Check if the 'country' field is not equal to "USA"
-notEqual("country", "USA");
-
-```
- |
-| [notEqualAny(fieldName, values)](./firestore_pipelines.md#notequalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny("status", [constant("pending"), field("rejectedStatus")]);
-
-```
- |
-| [notEqualAny(fieldName, arrayExpression)](./firestore_pipelines.md#notequalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the values in the evaluated expression.
-```typescript
-// Check if the 'status' field is not equal to any value in the field 'rejectedStatuses'
-notEqualAny("status", field("rejectedStatuses"));
-
-```
- |
-| [regexContains(fieldName, pattern)](./firestore_pipelines.md#regexcontains_67f7432) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains("description", "(?i)example");
-
-```
- |
-| [regexContains(fieldName, pattern)](./firestore_pipelines.md#regexcontains_cb1318d) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring.
-```typescript
-// Check if the 'description' field contains "example" (case-insensitive)
-regexContains("description", field("pattern"));
-
-```
- |
-| [regexMatch(fieldName, pattern)](./firestore_pipelines.md#regexmatch_67f7432) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch("email", "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
-
-```
- |
-| [regexMatch(fieldName, pattern)](./firestore_pipelines.md#regexmatch_cb1318d) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression.
-```typescript
-// Check if the 'email' field matches a valid email pattern
-regexMatch("email", field("pattern"));
-
-```
- |
-| [round(fieldName)](./firestore_pipelines.md#round_e5b0480) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number.
-```typescript
-// Round the value of the 'price' field.
-round("price");
-
-```
- |
-| [round(fieldName, decimalPlaces)](./firestore_pipelines.md#round_07d0cf0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places.
-```typescript
-// Round the value of the 'price' field to two decimal places.
-round("price", 2);
-
-```
- |
+| [greaterThan(fieldName, expression)](./firestore_pipelines.md#greaterthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is greater than an expression. |
+| [greaterThan(fieldName, value)](./firestore_pipelines.md#greaterthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than a constant value. |
+| [greaterThanOrEqual(fieldName, value)](./firestore_pipelines.md#greaterthanorequal_2e16acb) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to an expression. |
+| [greaterThanOrEqual(fieldName, value)](./firestore_pipelines.md#greaterthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is greater than or equal to a constant value. |
+| [length\_2(fieldName)](./firestore_pipelines.md#length_2_e5b0480) | (Public Preview) Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
+| [lessThan(fieldName, expression)](./firestore_pipelines.md#lessthan_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than an expression. |
+| [lessThan(fieldName, value)](./firestore_pipelines.md#lessthan_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than a constant value. |
+| [lessThanOrEqual(fieldName, expression)](./firestore_pipelines.md#lessthanorequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to an expression. |
+| [lessThanOrEqual(fieldName, value)](./firestore_pipelines.md#lessthanorequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is less than or equal to a constant value. |
+| [like(fieldName, pattern)](./firestore_pipelines.md#like_67f7432) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field. |
+| [like(fieldName, pattern)](./firestore_pipelines.md#like_cb1318d) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison against a field. |
+| [ln(fieldName)](./firestore_pipelines.md#ln_e5b0480) | (Public Preview) Creates an expression that computes the natural logarithm of a numeric value. |
+| [log(fieldName, base)](./firestore_pipelines.md#log_a89e21b) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base. |
+| [log(fieldName, base)](./firestore_pipelines.md#log_805b11f) | (Public Preview) Creates an expression that computes the logarithm of a field to a given base. |
+| [log10(fieldName)](./firestore_pipelines.md#log10_e5b0480) | (Public Preview) Creates an expression that computes the base-10 logarithm of a numeric value. |
+| [logicalMaximum(fieldName, second, others)](./firestore_pipelines.md#logicalmaximum_828272e) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering. |
+| [logicalMinimum(fieldName, second, others)](./firestore_pipelines.md#logicalminimum_828272e) | (Public Preview) Creates an expression that returns the smallest value between a field's value and other input expressions or literal values. Based on Firestore's value type ordering. |
+| [mapGet(fieldName, subField)](./firestore_pipelines.md#mapget_06663cf) | (Public Preview) Accesses a value from a map (object) field using the provided key. |
+| [maximum(fieldName)](./firestore_pipelines.md#maximum_e5b0480) | (Public Preview) Creates an aggregation that finds the maximum value of a field across multiple stage inputs. |
+| [minimum(fieldName)](./firestore_pipelines.md#minimum_e5b0480) | (Public Preview) Creates an aggregation that finds the minimum value of a field across multiple stage inputs. |
+| [mod(fieldName, expression)](./firestore_pipelines.md#mod_1e91657) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by an expression. |
+| [mod(fieldName, value)](./firestore_pipelines.md#mod_65e2f32) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing a field's value by a constant. |
+| [multiply(fieldName, second)](./firestore_pipelines.md#multiply_b75bb8b) | (Public Preview) Creates an expression that multiplies a field's value by an expression. |
+| [notEqual(fieldName, expression)](./firestore_pipelines.md#notequal_1e91657) | (Public Preview) Creates an expression that checks if a field's value is not equal to an expression. |
+| [notEqual(fieldName, value)](./firestore_pipelines.md#notequal_65e2f32) | (Public Preview) Creates an expression that checks if a field's value is not equal to a constant value. |
+| [notEqualAny(fieldName, values)](./firestore_pipelines.md#notequalany_8060b23) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the provided values or expressions. |
+| [notEqualAny(fieldName, arrayExpression)](./firestore_pipelines.md#notequalany_48da8d9) | (Public Preview) Creates an expression that checks if a field's value is not equal to any of the values in the evaluated expression. |
+| [regexContains(fieldName, pattern)](./firestore_pipelines.md#regexcontains_67f7432) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring. |
+| [regexContains(fieldName, pattern)](./firestore_pipelines.md#regexcontains_cb1318d) | (Public Preview) Creates an expression that checks if a string field contains a specified regular expression as a substring. |
+| [regexMatch(fieldName, pattern)](./firestore_pipelines.md#regexmatch_67f7432) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression. |
+| [regexMatch(fieldName, pattern)](./firestore_pipelines.md#regexmatch_cb1318d) | (Public Preview) Creates an expression that checks if a string field matches a specified regular expression. |
+| [round(fieldName)](./firestore_pipelines.md#round_e5b0480) | (Public Preview) Creates an expression that rounds a numeric value to the nearest whole number. |
+| [round(fieldName, decimalPlaces)](./firestore_pipelines.md#round_07d0cf0) | (Public Preview) Creates an expression that rounds a numeric value to the specified number of decimal places. |
| [split(fieldName, delimiter)](./firestore_pipelines.md#split_2cfdd37) | (Public Preview) Creates an expression that splits the value of a field on the provided delimiter. |
| [split(fieldName, delimiter)](./firestore_pipelines.md#split_f4fe06a) | (Public Preview) Creates an expression that splits the value of a field on the provided delimiter. |
-| [sqrt(fieldName)](./firestore_pipelines.md#sqrt_e5b0480) | (Public Preview) Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt("value");
-
-```
- |
-| [startsWith(fieldName, prefix)](./firestore_pipelines.md#startswith_89325cc) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix.
-```typescript
-// Check if the 'name' field starts with "Mr."
-startsWith("name", "Mr.");
-
-```
- |
-| [startsWith(fieldName, prefix)](./firestore_pipelines.md#startswith_266c338) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix.
-```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-startsWith("fullName", field("firstName"));
-
-```
- |
-| [stringConcat(fieldName, secondString, otherStrings)](./firestore_pipelines.md#stringconcat_d80077e) | (Public Preview) Creates an expression that concatenates string functions, fields or constants together.
-```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-stringConcat("firstName", " ", field("lastName"));
-
-```
- |
-| [stringContains(fieldName, substring)](./firestore_pipelines.md#stringcontains_5b94cfe) | (Public Preview) Creates an expression that checks if a string field contains a specified substring.
-```typescript
-// Check if the 'description' field contains "example".
-stringContains("description", "example");
-
-```
- |
-| [stringContains(fieldName, substring)](./firestore_pipelines.md#stringcontains_ac3ba47) | (Public Preview) Creates an expression that checks if a string field contains a substring specified by an expression.
-```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-stringContains("description", field("keyword"));
-
-```
- |
-| [subtract(fieldName, expression)](./firestore_pipelines.md#subtract_1e91657) | (Public Preview) Creates an expression that subtracts an expression from a field's value.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract("price", field("discount"));
-
-```
- |
-| [subtract(fieldName, value)](./firestore_pipelines.md#subtract_65e2f32) | (Public Preview) Creates an expression that subtracts a constant value from a field's value.
-```typescript
-// Subtract 20 from the value of the 'total' field
-subtract("total", 20);
-
-```
- |
-| [sum(fieldName)](./firestore_pipelines.md#sum_e5b0480) | (Public Preview) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs.
-```typescript
-// Calculate the total revenue from a set of orders
-sum("orderAmount").as("totalRevenue");
-
-```
- |
-| [timestampAdd(fieldName, unit, amount)](./firestore_pipelines.md#timestampadd_341fe7d) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp represented by a field.
-```typescript
-// Add 1 day to the 'timestamp' field.
-timestampAdd("timestamp", "day", 1);
-
-```
- |
-| [timestampSubtract(fieldName, unit, amount)](./firestore_pipelines.md#timestampsubtract_341fe7d) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field.
-```typescript
-// Subtract 1 day from the 'timestamp' field.
-timestampSubtract("timestamp", "day", 1);
-
-```
- |
-| [timestampToUnixMicros(fieldName)](./firestore_pipelines.md#timestamptounixmicros_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros("timestamp");
-
-```
- |
-| [timestampToUnixMillis(fieldName)](./firestore_pipelines.md#timestamptounixmillis_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis("timestamp");
-
-```
- |
-| [timestampToUnixSeconds(fieldName)](./firestore_pipelines.md#timestamptounixseconds_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds("timestamp");
-
-```
- |
+| [sqrt(fieldName)](./firestore_pipelines.md#sqrt_e5b0480) | (Public Preview) Creates an expression that computes the square root of a numeric value. |
+| [startsWith(fieldName, prefix)](./firestore_pipelines.md#startswith_89325cc) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix. |
+| [startsWith(fieldName, prefix)](./firestore_pipelines.md#startswith_266c338) | (Public Preview) Creates an expression that checks if a field's value starts with a given prefix. |
+| [stringConcat(fieldName, secondString, otherStrings)](./firestore_pipelines.md#stringconcat_d80077e) | (Public Preview) Creates an expression that concatenates string functions, fields or constants together. |
+| [stringContains(fieldName, substring)](./firestore_pipelines.md#stringcontains_5b94cfe) | (Public Preview) Creates an expression that checks if a string field contains a specified substring. |
+| [stringContains(fieldName, substring)](./firestore_pipelines.md#stringcontains_ac3ba47) | (Public Preview) Creates an expression that checks if a string field contains a substring specified by an expression. |
+| [subtract(fieldName, expression)](./firestore_pipelines.md#subtract_1e91657) | (Public Preview) Creates an expression that subtracts an expression from a field's value. |
+| [subtract(fieldName, value)](./firestore_pipelines.md#subtract_65e2f32) | (Public Preview) Creates an expression that subtracts a constant value from a field's value. |
+| [sum(fieldName)](./firestore_pipelines.md#sum_e5b0480) | (Public Preview) Creates an aggregation that calculates the sum of a field's values across multiple stage inputs. |
+| [timestampAdd(fieldName, unit, amount)](./firestore_pipelines.md#timestampadd_341fe7d) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp represented by a field. |
+| [timestampSubtract(fieldName, unit, amount)](./firestore_pipelines.md#timestampsubtract_341fe7d) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp represented by a field. |
+| [timestampToUnixMicros(fieldName)](./firestore_pipelines.md#timestamptounixmicros_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixMillis(fieldName)](./firestore_pipelines.md#timestamptounixmillis_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
+| [timestampToUnixSeconds(fieldName)](./firestore_pipelines.md#timestamptounixseconds_e5b0480) | (Public Preview) Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC). |
| [timestampTruncate(fieldName, granularity, timezone)](./firestore_pipelines.md#timestamptruncate_b6c7512) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
| [timestampTruncate(fieldName, granularity, timezone)](./firestore_pipelines.md#timestamptruncate_ed83d46) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
-| [toLower(fieldName)](./firestore_pipelines.md#tolower_e5b0480) | (Public Preview) Creates an expression that converts a string field to lowercase.
-```typescript
-// Convert the 'name' field to lowercase
-toLower("name");
-
-```
- |
-| [toUpper(fieldName)](./firestore_pipelines.md#toupper_e5b0480) | (Public Preview) Creates an expression that converts a string field to uppercase.
-```typescript
-// Convert the 'title' field to uppercase
-toUpper("title");
-
-```
- |
-| [trim(fieldName, valueToTrim)](./firestore_pipelines.md#trim_c9f90ee) | (Public Preview) Creates an expression that removes leading and trailing whitespace from a string or byte array.
-```typescript
-// Trim whitespace from the 'userInput' field
-trim("userInput");
-
-// Trim quotes from the 'userInput' field
-trim("userInput", '"');
-
-```
- |
+| [toLower(fieldName)](./firestore_pipelines.md#tolower_e5b0480) | (Public Preview) Creates an expression that converts a string field to lowercase. |
+| [toUpper(fieldName)](./firestore_pipelines.md#toupper_e5b0480) | (Public Preview) Creates an expression that converts a string field to uppercase. |
+| [trim(fieldName, valueToTrim)](./firestore_pipelines.md#trim_c9f90ee) | (Public Preview) Creates an expression that removes leading and trailing whitespace from a string or byte array. |
| [type(fieldName)](./firestore_pipelines.md#type_e5b0480) | (Public Preview) Creates an expression that returns the data type of the data in the specified field. |
-| [unixMicrosToTimestamp(fieldName)](./firestore_pipelines.md#unixmicrostotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp("microseconds");
-
-```
- |
-| [unixMillisToTimestamp(fieldName)](./firestore_pipelines.md#unixmillistotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp("milliseconds");
-
-```
- |
-| [unixSecondsToTimestamp(fieldName)](./firestore_pipelines.md#unixsecondstotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp("seconds");
-
-```
- |
-| [vectorLength(fieldName)](./firestore_pipelines.md#vectorlength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector represented by a field.
-```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength("embedding");
-
-```
- |
+| [unixMicrosToTimestamp(fieldName)](./firestore_pipelines.md#unixmicrostotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixMillisToTimestamp(fieldName)](./firestore_pipelines.md#unixmillistotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [unixSecondsToTimestamp(fieldName)](./firestore_pipelines.md#unixsecondstotimestamp_e5b0480) | (Public Preview) Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp. |
+| [vectorLength(fieldName)](./firestore_pipelines.md#vectorlength_e5b0480) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector represented by a field. |
| function(first, ...) |
-| [add(first, second)](./firestore_pipelines.md#add_846ca1b) | (Public Preview) Creates an expression that adds two expressions together.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add(field("quantity"), field("reserve"));
-
-```
- |
-| [and(first, second, more)](./firestore_pipelines.md#and_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'AND' operation on multiple filter conditions.
-```typescript
-// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND
-// the 'status' field is "active"
-const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
-
-```
- |
-| [concat(first, second, others)](./firestore_pipelines.md#concat_83be015) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
-```typescript
-// Concatenate the 'firstName' and 'lastName' fields with a space in between.
-concat(field("firstName"), " ", field("lastName"))
-
-```
- |
-| [logicalMaximum(first, second, others)](./firestore_pipelines.md#logicalmaximum_83be015) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the largest value between the 'field1' field, the 'field2' field,
-// and 1000
-logicalMaximum(field("field1"), field("field2"), 1000);
-
-```
- |
-| [logicalMinimum(first, second, others)](./firestore_pipelines.md#logicalminimum_83be015) | (Public Preview) Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering.
-```typescript
-// Returns the smallest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMinimum(field("field1"), field("field2"), 1000);
-
-```
- |
-| [multiply(first, second)](./firestore_pipelines.md#multiply_846ca1b) | (Public Preview) Creates an expression that multiplies two expressions together.
-```typescript
-// Multiply the 'quantity' field by the 'price' field
-multiply(field("quantity"), field("price"));
-
-```
- |
-| [or(first, second, more)](./firestore_pipelines.md#or_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'OR' operation on multiple filter conditions.
-```typescript
-// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR
-// the 'status' field is "active"
-const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
-
-```
- |
-| [xor(first, second, additionalConditions)](./firestore_pipelines.md#xor_8197113) | (Public Preview) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions.
-```typescript
-// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London",
-// or 'status' is "active".
-const condition = xor(
- greaterThan("age", 18),
- equal("city", "London"),
- equal("status", "active"));
-
-```
- |
+| [add(first, second)](./firestore_pipelines.md#add_846ca1b) | (Public Preview) Creates an expression that adds two expressions together. |
+| [and(first, second, more)](./firestore_pipelines.md#and_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'AND' operation on multiple filter conditions. |
+| [concat(first, second, others)](./firestore_pipelines.md#concat_83be015) | (Public Preview) Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed. |
+| [logicalMaximum(first, second, others)](./firestore_pipelines.md#logicalmaximum_83be015) | (Public Preview) Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering. |
+| [logicalMinimum(first, second, others)](./firestore_pipelines.md#logicalminimum_83be015) | (Public Preview) Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering. |
+| [multiply(first, second)](./firestore_pipelines.md#multiply_846ca1b) | (Public Preview) Creates an expression that multiplies two expressions together. |
+| [or(first, second, more)](./firestore_pipelines.md#or_e0c48bd) | (Public Preview) Creates an expression that performs a logical 'OR' operation on multiple filter conditions. |
+| [xor(first, second, additionalConditions)](./firestore_pipelines.md#xor_8197113) | (Public Preview) Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions. |
| function(firstArray, ...) |
-| [arrayConcat(firstArray, secondArray, otherArrays)](./firestore_pipelines.md#arrayconcat_c00d5d7) | (Public Preview) Creates an expression that concatenates an array expression with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat(field("items"), [field("newItems"), field("otherItems")]);
-
-```
- |
-| function(firstArrayField, ...) |
-| [arrayConcat(firstArrayField, secondArray, otherArrays)](./firestore_pipelines.md#arrayconcat_f92063d) | (Public Preview) Creates an expression that concatenates a field's array value with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat("items", [field("newItems"), field("otherItems")]);
-
-```
- |
+| [arrayConcat(firstArray, secondArray, otherArrays)](./firestore_pipelines.md#arrayconcat_c00d5d7) | (Public Preview) Creates an expression that concatenates an array expression with other arrays. |
+| function(firstArrayField, ...) |
+| [arrayConcat(firstArrayField, secondArray, otherArrays)](./firestore_pipelines.md#arrayconcat_f92063d) | (Public Preview) Creates an expression that concatenates a field's array value with other arrays. |
| function(firstMap, ...) |
-| [mapMerge(firstMap, secondMap, otherMaps)](./firestore_pipelines.md#mapmerge_cfe77ce) | (Public Preview) Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge(field('settings'), { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
- |
+| [mapMerge(firstMap, secondMap, otherMaps)](./firestore_pipelines.md#mapmerge_cfe77ce) | (Public Preview) Creates an expression that merges multiple map values. |
| function(firstString, ...) |
-| [stringConcat(firstString, secondString, otherStrings)](./firestore_pipelines.md#stringconcat_8a8d1b6) | (Public Preview) Creates an expression that concatenates string expressions together.
-```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-stringConcat(field("firstName"), " ", field("lastName"));
-
-```
- |
+| [stringConcat(firstString, secondString, otherStrings)](./firestore_pipelines.md#stringconcat_8a8d1b6) | (Public Preview) Creates an expression that concatenates string expressions together. |
| function(ifExpr, ...) |
-| [ifAbsent(ifExpr, elseExpr)](./firestore_pipelines.md#ifabsent_0e6d161) | (Public Preview) Creates an expression that returns the elseExpr argument if ifExpr is absent, else return the result of the ifExpr argument evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent(field("optional_field"), constant("default_value"))
-
-```
- |
-| [ifAbsent(ifExpr, elseValue)](./firestore_pipelines.md#ifabsent_c34e5ed) | (Public Preview) Creates an expression that returns the elseValue argument if ifExpr is absent, else return the result of the ifExpr argument evaluation.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent(field("optional_field"), "default_value")
-
-```
- |
+| [ifAbsent(ifExpr, elseExpr)](./firestore_pipelines.md#ifabsent_0e6d161) | (Public Preview) Creates an expression that returns the elseExpr argument if ifExpr is absent, else return the result of the ifExpr argument evaluation. |
+| [ifAbsent(ifExpr, elseValue)](./firestore_pipelines.md#ifabsent_c34e5ed) | (Public Preview) Creates an expression that returns the elseValue argument if ifExpr is absent, else return the result of the ifExpr argument evaluation. |
| function(ifFieldName, ...) |
-| [ifAbsent(ifFieldName, elseExpr)](./firestore_pipelines.md#ifabsent_e6dabea) | (Public Preview) Creates an expression that returns the elseExpr argument if ifFieldName is absent, else return the value of the field.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns the value of
-// 'default_field' if 'optional_field' is absent.
-ifAbsent("optional_field", field("default_field"))
-
-```
- |
-| [ifAbsent(ifFieldName, elseValue)](./firestore_pipelines.md#ifabsent_d8f2823) | (Public Preview) Creates an expression that returns the elseValue argument if ifFieldName is absent, else return the value of the field.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent("optional_field", "default_value")
-
-```
- |
+| [ifAbsent(ifFieldName, elseExpr)](./firestore_pipelines.md#ifabsent_e6dabea) | (Public Preview) Creates an expression that returns the elseExpr argument if ifFieldName is absent, else return the value of the field. |
+| [ifAbsent(ifFieldName, elseValue)](./firestore_pipelines.md#ifabsent_d8f2823) | (Public Preview) Creates an expression that returns the elseValue argument if ifFieldName is absent, else return the value of the field. |
| function(input, ...) |
| [substring(input, position, length)](./firestore_pipelines.md#substring_e6e0aa3) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
| [substring(input, position, length)](./firestore_pipelines.md#substring_ab56dc6) | (Public Preview) Creates an expression that returns a substring of a string or byte array. |
| function(left, ...) |
-| [divide(left, right)](./firestore_pipelines.md#divide_b3c3382) | (Public Preview) Creates an expression that divides two expressions.
-```typescript
-// Divide the 'total' field by the 'count' field
-divide(field("total"), field("count"));
-
-```
- |
-| [equal(left, right)](./firestore_pipelines.md#equal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are equal.
-```typescript
-// Check if the 'age' field is equal to an expression
-equal(field("age"), field("minAge").add(10));
-
-```
- |
-| [greaterThan(left, right)](./firestore_pipelines.md#greaterthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than the second expression.
-```typescript
-// Check if the 'age' field is greater than 18
-greaterThan(field("age"), Constant(9).add(9));
-
-```
- |
-| [greaterThanOrEqual(left, right)](./firestore_pipelines.md#greaterthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than or equal to the second expression.
-```typescript
-// Check if the 'quantity' field is greater than or equal to the field "threshold"
-greaterThanOrEqual(field("quantity"), field("threshold"));
-
-```
- |
-| [lessThan(left, right)](./firestore_pipelines.md#lessthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than the second expression.
-```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), field("limit"));
-
-```
- |
-| [lessThanOrEqual(left, right)](./firestore_pipelines.md#lessthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than or equal to the second expression.
-```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), field("limit"));
-
-```
- |
-| [mod(left, right)](./firestore_pipelines.md#mod_b3c3382) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing two expressions.
-```typescript
-// Calculate the remainder of dividing 'field1' by 'field2'.
-mod(field("field1"), field("field2"));
-
-```
- |
-| [notEqual(left, right)](./firestore_pipelines.md#notequal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are not equal.
-```typescript
-// Check if the 'status' field is not equal to field 'finalState'
-notEqual(field("status"), field("finalState"));
-
-```
- |
+| [divide(left, right)](./firestore_pipelines.md#divide_b3c3382) | (Public Preview) Creates an expression that divides two expressions. |
+| [equal(left, right)](./firestore_pipelines.md#equal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are equal. |
+| [greaterThan(left, right)](./firestore_pipelines.md#greaterthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than the second expression. |
+| [greaterThanOrEqual(left, right)](./firestore_pipelines.md#greaterthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is greater than or equal to the second expression. |
+| [lessThan(left, right)](./firestore_pipelines.md#lessthan_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than the second expression. |
+| [lessThanOrEqual(left, right)](./firestore_pipelines.md#lessthanorequal_b3c3382) | (Public Preview) Creates an expression that checks if the first expression is less than or equal to the second expression. |
+| [mod(left, right)](./firestore_pipelines.md#mod_b3c3382) | (Public Preview) Creates an expression that calculates the modulo (remainder) of dividing two expressions. |
+| [notEqual(left, right)](./firestore_pipelines.md#notequal_b3c3382) | (Public Preview) Creates an expression that checks if two expressions are not equal. |
| [pipelineResultEqual(left, right)](./firestore_pipelines.md#pipelineresultequal_707a755) | (Public Preview) Test equality of two PipelineResults. |
-| [subtract(left, right)](./firestore_pipelines.md#subtract_b3c3382) | (Public Preview) Creates an expression that subtracts two expressions.
-```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract(field("price"), field("discount"));
-
-```
- |
+| [subtract(left, right)](./firestore_pipelines.md#subtract_b3c3382) | (Public Preview) Creates an expression that subtracts two expressions. |
| function(mapExpr, ...) |
-| [mapRemove(mapExpr, key)](./firestore_pipelines.md#mapremove_23c7d51) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression.
-```
-// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), 'baz');
-
-```
- |
-| [mapRemove(mapExpr, keyExpr)](./firestore_pipelines.md#mapremove_9fbcaa3) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression.
-```
-// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
-
-```
- |
+| [mapRemove(mapExpr, key)](./firestore_pipelines.md#mapremove_23c7d51) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression. |
+| [mapRemove(mapExpr, keyExpr)](./firestore_pipelines.md#mapremove_9fbcaa3) | (Public Preview) Creates an expression that removes a key from the map produced by evaluating an expression. |
| function(mapExpression, ...) |
-| [mapGet(mapExpression, subField)](./firestore_pipelines.md#mapget_688c050) | (Public Preview) Accesses a value from a map (object) expression using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-mapGet(field("address"), "city");
-
-```
- |
-| function(mapField, ...) |
-| [mapMerge(mapField, secondMap, otherMaps)](./firestore_pipelines.md#mapmerge_70a564b) | (Public Preview) Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge('settings', { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
- |
-| [mapRemove(mapField, key)](./firestore_pipelines.md#mapremove_bd5726e) | (Public Preview) Creates an expression that removes a key from the map at the specified field name.
-```
-// Removes the key 'city' field from the map in the address field of the input document.
-mapRemove('address', 'city');
-
-```
- |
-| [mapRemove(mapField, keyExpr)](./firestore_pipelines.md#mapremove_8406d13) | (Public Preview) Creates an expression that removes a key from the map at the specified field name.
-```
-// Removes the key 'city' field from the map in the address field of the input document.
-mapRemove('address', constant('city'));
-
-```
- |
-| function(name, ...) |
-| [field(name)](./firestore_pipelines.md#field_1eaaff4) | (Public Preview) Creates a instance representing the field at the given path.The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field (e.g., "address.city").
-```typescript
-// Create a Field instance for the 'title' field
-const titleField = field("title");
-
-// Create a Field instance for a nested field 'author.firstName'
-const authorFirstNameField = field("author.firstName");
-
-```
- |
-| function(options, ...) |
-| [execute(options)](./firestore_pipelines.md#execute_9e87e31) | (Public Preview) Executes a pipeline and returns a Promise to represent the asynchronous operation.The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.The pipeline results are returned as a that contains a list of objects. Each typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:
|
+| function(path, ...) |
+| [field(path)](./firestore_pipelines.md#field_34ee07d) | (Public Preview) Creates a [Field](./firestore_pipelines.field.md#field_class) instance representing the field at the given path. |
+| function(pipeline, ...) |
+| [execute(pipeline)](./firestore_pipelines.md#execute_01df620) | (Public Preview) Executes a pipeline and returns a Promise to represent the asynchronous operation.The returned Promise can be used to track the progress of the pipeline execution and retrieve the results (or handle any errors) asynchronously.The pipeline results are returned as a [PipelineSnapshot](./firestore_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) that contains a list of [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) objects. Each [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) typically represents a single key/value map that has passed through all the stages of the pipeline, however this might differ depending on the stages involved in the pipeline. For example:
|
+| function(stringExpression, ...) |
+| [charLength(stringExpression)](./firestore_pipelines.md#charlength_c25a54a) | (Public Preview) Creates an expression that calculates the character length of a string expression in UTF-8. |
+| [endsWith(stringExpression, suffix)](./firestore_pipelines.md#endswith_0a0b889) | (Public Preview) Creates an expression that checks if a string expression ends with a given postfix. |
+| [endsWith(stringExpression, suffix)](./firestore_pipelines.md#endswith_13aee0d) | (Public Preview) Creates an expression that checks if a string expression ends with a given postfix. |
+| [like(stringExpression, pattern)](./firestore_pipelines.md#like_a84c581) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison. |
+| [like(stringExpression, pattern)](./firestore_pipelines.md#like_b534848) | (Public Preview) Creates an expression that performs a case-sensitive wildcard string comparison. |
+| [regexContains(stringExpression, pattern)](./firestore_pipelines.md#regexcontains_a84c581) | (Public Preview) Creates an expression that checks if a string expression contains a specified regular expression as a substring. |
+| [regexContains(stringExpression, pattern)](./firestore_pipelines.md#regexcontains_b534848) | (Public Preview) Creates an expression that checks if a string expression contains a specified regular expression as a substring. |
+| [regexMatch(stringExpression, pattern)](./firestore_pipelines.md#regexmatch_a84c581) | (Public Preview) Creates an expression that checks if a string expression matches a specified regular expression. |
+| [regexMatch(stringExpression, pattern)](./firestore_pipelines.md#regexmatch_b534848) | (Public Preview) Creates an expression that checks if a string expression matches a specified regular expression. |
+| [reverse(stringExpression)](./firestore_pipelines.md#reverse_c25a54a) | (Public Preview) Creates an expression that reverses a string. |
+| [startsWith(stringExpression, prefix)](./firestore_pipelines.md#startswith_75c3dbb) | (Public Preview) Creates an expression that checks if a string expression starts with a given prefix. |
+| [startsWith(stringExpression, prefix)](./firestore_pipelines.md#startswith_52f218a) | (Public Preview) Creates an expression that checks if a string expression starts with a given prefix. |
+| [stringContains(stringExpression, substring)](./firestore_pipelines.md#stringcontains_3e9ff32) | (Public Preview) Creates an expression that checks if a string expression contains a specified substring. |
+| [stringContains(stringExpression, substring)](./firestore_pipelines.md#stringcontains_cc6ee02) | (Public Preview) Creates an expression that checks if a string expression contains a substring specified by another expression. |
+| [stringReverse(stringExpression)](./firestore_pipelines.md#stringreverse_c25a54a) | (Public Preview) Creates an expression that reverses a string. |
+| [toLower(stringExpression)](./firestore_pipelines.md#tolower_c25a54a) | (Public Preview) Creates an expression that converts a string expression to lowercase. |
+| [toUpper(stringExpression)](./firestore_pipelines.md#toupper_c25a54a) | (Public Preview) Creates an expression that converts a string expression to uppercase. |
+| [trim(stringExpression, valueToTrim)](./firestore_pipelines.md#trim_dd54322) | (Public Preview) Creates an expression that removes leading and trailing characters from a string or byte array expression. |
+| function(timestamp, ...) |
+| [timestampAdd(timestamp, unit, amount)](./firestore_pipelines.md#timestampadd_98418f9) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp. |
+| [timestampAdd(timestamp, unit, amount)](./firestore_pipelines.md#timestampadd_ffe8e57) | (Public Preview) Creates an expression that adds a specified amount of time to a timestamp. |
+| [timestampSubtract(timestamp, unit, amount)](./firestore_pipelines.md#timestampsubtract_98418f9) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp. |
+| [timestampSubtract(timestamp, unit, amount)](./firestore_pipelines.md#timestampsubtract_ffe8e57) | (Public Preview) Creates an expression that subtracts a specified amount of time from a timestamp. |
| function(timestampExpression, ...) |
| [timestampTruncate(timestampExpression, granularity, timezone)](./firestore_pipelines.md#timestamptruncate_ad5d843) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
| [timestampTruncate(timestampExpression, granularity, timezone)](./firestore_pipelines.md#timestamptruncate_d6ab2a4) | (Public Preview) Creates an expression that truncates a timestamp to a specified granularity. |
| function(tryExpr, ...) |
-| [ifError(tryExpr, catchExpr)](./firestore_pipelines.md#iferror_a99a327) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.This overload is useful when a BooleanExpression is required.
-```typescript
-// Create an expression that protects against a divide by zero error
-// but always returns a boolean expression.
-ifError(constant(50).divide('length').gt(1), constant(false));
-
-```
- |
-| [ifError(tryExpr, catchExpr)](./firestore_pipelines.md#iferror_756c12e) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// the entire title field if the array is empty or the field is another type.
-ifError(field("title").arrayGet(0), field("title"));
-
-```
- |
-| [ifError(tryExpr, catchValue)](./firestore_pipelines.md#iferror_dc532f9) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.
-```typescript
-// Returns the first item in the title field arrays, or returns
-// "Default Title"
-ifError(field("title").arrayGet(0), "Default Title");
-
-```
- |
+| [ifError(tryExpr, catchExpr)](./firestore_pipelines.md#iferror_a99a327) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation.This overload is useful when a BooleanExpression is required. |
+| [ifError(tryExpr, catchExpr)](./firestore_pipelines.md#iferror_756c12e) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation. |
+| [ifError(tryExpr, catchValue)](./firestore_pipelines.md#iferror_dc532f9) | (Public Preview) Creates an expression that returns the catch argument if there is an error, else return the result of the try argument evaluation. |
| function(value, ...) |
| [constant(value)](./firestore_pipelines.md#constant_0c00f91) | (Public Preview) Creates a Constant instance for a number value. |
| [constant(value)](./firestore_pipelines.md#constant_6dac335) | (Public Preview) Creates a Constant instance for a VectorValue value. |
@@ -1651,78 +300,17 @@ ifError(field("title").arrayGet(0), "Default Title");
| [constant(value)](./firestore_pipelines.md#constant_5131bf7) | (Public Preview) Creates a Constant instance for a Date value. |
| [constant(value)](./firestore_pipelines.md#constant_fdf565d) | (Public Preview) Creates a Constant instance for a Bytes value. |
| [constant(value)](./firestore_pipelines.md#constant_bcd2b0b) | (Public Preview) Creates a Constant instance for a DocumentReference value. |
-| [exists(value)](./firestore_pipelines.md#exists_f3daf14) | (Public Preview) Creates an expression that checks if a field exists.
-```typescript
-// Check if the document has a field named "phoneNumber"
-exists(field("phoneNumber"));
-
-```
- |
-| [isAbsent(value)](./firestore_pipelines.md#isabsent_f3daf14) | (Public Preview) Creates an expression that returns true if a value is absent. Otherwise, returns false even if the value is null.
-```typescript
-// Check if the field `value` is absent.
-isAbsent(field("value"));
-
-```
- |
-| [isError(value)](./firestore_pipelines.md#iserror_f3daf14) | (Public Preview) Creates an expression that checks if a given expression produces an error.
-```typescript
-// Check if the result of a calculation is an error
-isError(field("title").arrayContains(1));
-
-```
- |
+| [exists(value)](./firestore_pipelines.md#exists_f3daf14) | (Public Preview) Creates an expression that checks if a field exists. |
+| [isAbsent(value)](./firestore_pipelines.md#isabsent_f3daf14) | (Public Preview) Creates an expression that returns true if a value is absent. Otherwise, returns false even if the value is null. |
+| [isError(value)](./firestore_pipelines.md#iserror_f3daf14) | (Public Preview) Creates an expression that checks if a given expression produces an error. |
| function(vectorExpression, ...) |
-| [cosineDistance(vectorExpression, vector)](./firestore_pipelines.md#cosinedistance_3a80317) | (Public Preview) Calculates the Cosine distance between a vector expression and a vector literal.
-```typescript
-// Calculate the cosine distance between the 'location' field and a target location
-cosineDistance(field("location"), [37.7749, -122.4194]);
-
-```
- |
-| [cosineDistance(vectorExpression, otherVectorExpression)](./firestore_pipelines.md#cosinedistance_17b5bcc) | (Public Preview) Calculates the Cosine distance between two vector expressions.
-```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-cosineDistance(field("userVector"), field("itemVector"));
-
-```
- |
-| [dotProduct(vectorExpression, vector)](./firestore_pipelines.md#dotproduct_3a80317) | (Public Preview) Calculates the dot product between a vector expression and a double array.
-```typescript
-// Calculate the dot product between a feature vector and a target vector
-dotProduct(field("features"), [0.5, 0.8, 0.2]);
-
-```
- |
-| [dotProduct(vectorExpression, otherVectorExpression)](./firestore_pipelines.md#dotproduct_17b5bcc) | (Public Preview) Calculates the dot product between two vector expressions.
-```typescript
-// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2'
-dotProduct(field("docVector1"), field("docVector2"));
-
-```
- |
-| [euclideanDistance(vectorExpression, vector)](./firestore_pipelines.md#euclideandistance_3a80317) | (Public Preview) Calculates the Euclidean distance between a vector expression and a double array.
-```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-
-euclideanDistance(field("location"), [37.7749, -122.4194]);
-
-```
- |
-| [euclideanDistance(vectorExpression, otherVectorExpression)](./firestore_pipelines.md#euclideandistance_17b5bcc) | (Public Preview) Calculates the Euclidean distance between two vector expressions.
-```typescript
-// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
-euclideanDistance(field("pointA"), field("pointB"));
-
-```
- |
-| [vectorLength(vectorExpression)](./firestore_pipelines.md#vectorlength_58a039b) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector.
-```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength(field("embedding"));
-
-```
- |
+| [cosineDistance(vectorExpression, vector)](./firestore_pipelines.md#cosinedistance_3a80317) | (Public Preview) Calculates the Cosine distance between a vector expression and a vector literal. |
+| [cosineDistance(vectorExpression, otherVectorExpression)](./firestore_pipelines.md#cosinedistance_17b5bcc) | (Public Preview) Calculates the Cosine distance between two vector expressions. |
+| [dotProduct(vectorExpression, vector)](./firestore_pipelines.md#dotproduct_3a80317) | (Public Preview) Calculates the dot product between a vector expression and a double array. |
+| [dotProduct(vectorExpression, otherVectorExpression)](./firestore_pipelines.md#dotproduct_17b5bcc) | (Public Preview) Calculates the dot product between two vector expressions. |
+| [euclideanDistance(vectorExpression, vector)](./firestore_pipelines.md#euclideandistance_3a80317) | (Public Preview) Calculates the Euclidean distance between a vector expression and a double array. |
+| [euclideanDistance(vectorExpression, otherVectorExpression)](./firestore_pipelines.md#euclideandistance_17b5bcc) | (Public Preview) Calculates the Euclidean distance between two vector expressions. |
+| [vectorLength(vectorExpression)](./firestore_pipelines.md#vectorlength_58a039b) | (Public Preview) Creates an expression that calculates the length of a Firestore Vector. |
## Classes
@@ -1736,32 +324,23 @@ vectorLength(field("embedding"));
| [CollectionReference](./firestore_pipelines.collectionreference.md#collectionreference_class) | A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.md#query_9f7b0f4)). |
| [DocumentReference](./firestore_pipelines.documentreference.md#documentreference_class) | A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. |
| [DocumentSnapshot](./firestore_pipelines.documentsnapshot.md#documentsnapshot_class) | A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get(<field>) to get a specific field.For a DocumentSnapshot that points to a non-existing document, any data access will return 'undefined'. You can use the exists() method to explicitly verify a document's existence. |
-| [Expression](./firestore_pipelines.expression.md#expression_class) | (Public Preview) Represents an expression that can be evaluated to a value within the execution of a .Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:- \*\*Field references:\*\* Access values from document fields. - \*\*Literals:\*\* Represent constant values (strings, numbers, booleans). - \*\*Function calls:\*\* Apply functions to one or more expressions.The Expr class provides a fluent API for building expressions. You can chain together method calls to create complex expressions. |
-| [Field](./firestore_pipelines.field.md#field_class) | (Public Preview) Represents a reference to a field in a Firestore document, or outputs of a stage.Field instance using the static method:
-```typescript
-// Create a Field instance for the 'name' field
-const nameField = field("name");
-
-// Create a Field instance for a nested field 'address.city'
-const cityField = field("address.city");
-
-```
- |
+| [Expression](./firestore_pipelines.expression.md#expression_class) | (Public Preview) Represents an expression that can be evaluated to a value within the execution of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).Expressions are the building blocks for creating complex queries and transformations in Firestore pipelines. They can represent:- \*\*Field references:\*\* Access values from document fields. - \*\*Literals:\*\* Represent constant values (strings, numbers, booleans). - \*\*Function calls:\*\* Apply functions to one or more expressions.The Expression class provides a fluent API for building expressions. You can chain together method calls to create complex expressions. |
+| [Field](./firestore_pipelines.field.md#field_class) | (Public Preview) Represents a reference to a field in a Firestore document, or outputs of a [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) stage.Field instance using the static method: |
| [FieldPath](./firestore_pipelines.fieldpath.md#fieldpath_class) | A FieldPath refers to a field in a document. The path may consist of a single field name (referring to a top-level field in the document), or a list of field names (referring to a nested field in the document).Create a FieldPath by providing field names. If more than one field name is provided, the path will point to a nested field in a document. |
| [FieldValue](./firestore_pipelines.fieldvalue.md#fieldvalue_class) | Sentinel values that can be used when writing document fields with set() or update(). |
| [Firestore](./firestore_pipelines.firestore.md#firestore_class) | The Cloud Firestore service interface.Do not call this constructor directly. Instead, use [getFirestore()](./firestore_.md#getfirestore). |
-| [FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class) | (Public Preview) This class defines the base class for Firestore functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_.md#and_e72c712), , or the methods on (, , etc.) to construct new Function instances. |
+| [FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class) | (Public Preview) This class defines the base class for Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) functions, which can be evaluated within pipeline execution.Typically, you would not use this class or its children directly. Use either the functions like [and()](./firestore_pipelines.md#and_e0c48bd), [equal()](./firestore_pipelines.md#equal_b3c3382), or the methods on [Expression](./firestore_pipelines.expression.md#expression_class) ([Expression.equal()](./firestore_pipelines.expression.md#expressionequal), [Expression.lessThan()](./firestore_pipelines.expression.md#expressionlessthan), etc.) to construct new Function instances. |
| [GeoPoint](./firestore_pipelines.geopoint.md#geopoint_class) | An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.Latitude values are in the range of \[-90, 90\]. Longitude values are in the range of \[-180, 180\]. |
| [Ordering](./firestore_pipelines.ordering.md#ordering_class) | (Public Preview) Represents an ordering criterion for sorting documents in a Firestore pipeline.You create Ordering instances using the ascending and descending helper functions. |
| [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class) | (Public Preview) |
-| [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) | (Public Preview) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.ref will return a undefined value. |
-| [PipelineSnapshot](./firestore_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) | (Public Preview) Represents the results of a Firestore pipeline execution.A PipelineSnapshot contains zero or more objects representing the documents returned by a pipeline query. It provides methods to iterate over the documents and access metadata about the query results. |
-| [PipelineSource](./firestore_pipelines.pipelinesource.md#pipelinesource_class) | (Public Preview) Provides the entry point for defining the data source of a Firestore .Use the methods of this class (e.g., , , , or ) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents. |
+| [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) | (Public Preview) A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the [PipelineResult.data()](./firestore_pipelines.pipelineresult.md#pipelineresultdata) or [PipelineResult.get()](./firestore_pipelines.pipelineresult.md#pipelineresultget) methods.ref will return a undefined value. |
+| [PipelineSnapshot](./firestore_pipelines.pipelinesnapshot.md#pipelinesnapshot_class) | (Public Preview) Represents the results of a Firestore pipeline execution.A PipelineSnapshot contains zero or more [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) objects representing the documents returned by a pipeline query. It provides methods to iterate over the documents and access metadata about the query results. |
+| [PipelineSource](./firestore_pipelines.pipelinesource.md#pipelinesource_class) | (Public Preview) Provides the entry point for defining the data source of a Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).Use the methods of this class (e.g., [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection), [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup), [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase), or [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments)) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents. |
| [Query](./firestore_pipelines.query.md#query_class) | A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering. |
| [QueryDocumentSnapshot](./firestore_pipelines.querydocumentsnapshot.md#querydocumentsnapshot_class) | A QueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'. |
| [SnapshotMetadata](./firestore_pipelines.snapshotmetadata.md#snapshotmetadata_class) | Metadata about a snapshot, describing the state of the snapshot. |
| [Timestamp](./firestore_pipelines.timestamp.md#timestamp_class) | A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.For examples and further specifications, refer to the [Timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). |
-| [VectorValue](./firestore_pipelines.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). VectorValue |
+| [VectorValue](./firestore_pipelines.vectorvalue.md#vectorvalue_class) | Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2). |
## Interfaces
@@ -1778,30 +357,30 @@ const cityField = field("address.city");
| Type Alias | Description |
| --- | --- |
-| [AddFieldsStageOptions](./firestore_pipelines.md#addfieldsstageoptions) | (Public Preview) Options defining how an AddFieldsStage is evaluated. See . |
-| [AggregateStageOptions](./firestore_pipelines.md#aggregatestageoptions) | (Public Preview) Options defining how an AggregateStage is evaluated. See . |
-| [CollectionGroupStageOptions](./firestore_pipelines.md#collectiongroupstageoptions) | (Public Preview) Defines the configuration options for a within a pipeline. This type extends and provides specific settings for how a collection group is identified and processed during pipeline execution. |
-| [CollectionStageOptions](./firestore_pipelines.md#collectionstageoptions) | (Public Preview) Options defining how a CollectionStage is evaluated. See . |
-| [DatabaseStageOptions](./firestore_pipelines.md#databasestageoptions) | (Public Preview) Options defining how a DatabaseStage is evaluated. See . |
-| [DistinctStageOptions](./firestore_pipelines.md#distinctstageoptions) | (Public Preview) Options defining how a DistinctStage is evaluated. See . |
-| [DocumentsStageOptions](./firestore_pipelines.md#documentsstageoptions) | (Public Preview) Options defining how a DocumentsStage is evaluated. See . |
+| [AddFieldsStageOptions](./firestore_pipelines.md#addfieldsstageoptions) | (Public Preview) Options defining how an AddFieldsStage is evaluated. See [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields). |
+| [AggregateStageOptions](./firestore_pipelines.md#aggregatestageoptions) | (Public Preview) Options defining how an AggregateStage is evaluated. See [Pipeline.aggregate()](./firestore_pipelines.pipeline.md#pipelineaggregate). |
+| [CollectionGroupStageOptions](./firestore_pipelines.md#collectiongroupstageoptions) | (Public Preview) Defines the configuration options for a CollectionGroupStage within a pipeline. This type extends [StageOptions](./firestore_pipelines.stageoptions.md#stageoptions_interface) and provides specific settings for how a collection group is identified and processed during pipeline execution.See [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup) to create a collection group stage. |
+| [CollectionStageOptions](./firestore_pipelines.md#collectionstageoptions) | (Public Preview) Options defining how a CollectionStage is evaluated. See [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection). |
+| [DatabaseStageOptions](./firestore_pipelines.md#databasestageoptions) | (Public Preview) Options defining how a DatabaseStage is evaluated. See [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase). |
+| [DistinctStageOptions](./firestore_pipelines.md#distinctstageoptions) | (Public Preview) Options defining how a DistinctStage is evaluated. See [Pipeline.distinct()](./firestore_pipelines.pipeline.md#pipelinedistinct). |
+| [DocumentsStageOptions](./firestore_pipelines.md#documentsstageoptions) | (Public Preview) Options defining how a DocumentsStage is evaluated. See [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments). |
| [ExpressionType](./firestore_pipelines.md#expressiontype) | (Public Preview) An enumeration of the different types of expressions. |
-| [FindNearestStageOptions](./firestore_pipelines.md#findneareststageoptions) | (Public Preview) Options defining how a FindNearestStage is evaluated. See . |
-| [LimitStageOptions](./firestore_pipelines.md#limitstageoptions) | (Public Preview) Options defining how a LimitStage is evaluated. See . |
-| [OffsetStageOptions](./firestore_pipelines.md#offsetstageoptions) | (Public Preview) Options defining how an OffsetStage is evaluated. See . |
-| [OneOf](./firestore_pipelines.md#oneof) | (Public Preview) Utility type to create an type that only allows one property of the Type param T to be set.type XorY = OneOf<{ x: unknown, y: unknown}> let a = { x: "foo" } // OK let b = { y: "foo" } // OK let c = { a: "foo", y: "foo" } // Not OK |
+| [FindNearestStageOptions](./firestore_pipelines.md#findneareststageoptions) | (Public Preview) Options defining how a FindNearestStage is evaluated. See [Pipeline.findNearest()](./firestore_pipelines.pipeline.md#pipelinefindnearest). |
+| [LimitStageOptions](./firestore_pipelines.md#limitstageoptions) | (Public Preview) Options defining how a LimitStage is evaluated. See [Pipeline.limit()](./firestore_pipelines.pipeline.md#pipelinelimit). |
+| [OffsetStageOptions](./firestore_pipelines.md#offsetstageoptions) | (Public Preview) Options defining how an OffsetStage is evaluated. See [Pipeline.offset()](./firestore_pipelines.pipeline.md#pipelineoffset). |
+| [OneOf](./firestore_pipelines.md#oneof) | (Public Preview) Utility type to create an type that only allows one property of the Type param T to be set. |
| [PartialWithFieldValue](./firestore_pipelines.md#partialwithfieldvalue) | Similar to TypeScript's Partial<T>, but allows nested fields to be omitted and FieldValues to be passed in as property values. |
| [Primitive](./firestore_pipelines.md#primitive) | Primitive types. |
-| [RemoveFieldsStageOptions](./firestore_pipelines.md#removefieldsstageoptions) | (Public Preview) Options defining how a RemoveFieldsStage is evaluated. See . |
-| [ReplaceWithStageOptions](./firestore_pipelines.md#replacewithstageoptions) | (Public Preview) Options defining how a ReplaceWithStage is evaluated. See . |
-| [SampleStageOptions](./firestore_pipelines.md#samplestageoptions) | (Public Preview) Defines the options for evaluating a sample stage within a pipeline. This type combines common with a specific configuration where only one of the defined sampling methods can be applied.See to create a sample stage.. |
-| [SelectStageOptions](./firestore_pipelines.md#selectstageoptions) | (Public Preview) Options defining how a SelectStage is evaluated. See . |
+| [RemoveFieldsStageOptions](./firestore_pipelines.md#removefieldsstageoptions) | (Public Preview) Options defining how a RemoveFieldsStage is evaluated. See [Pipeline.removeFields()](./firestore_pipelines.pipeline.md#pipelineremovefields). |
+| [ReplaceWithStageOptions](./firestore_pipelines.md#replacewithstageoptions) | (Public Preview) Options defining how a ReplaceWithStage is evaluated. See [Pipeline.replaceWith()](./firestore_pipelines.pipeline.md#pipelinereplacewith). |
+| [SampleStageOptions](./firestore_pipelines.md#samplestageoptions) | (Public Preview) Defines the options for evaluating a sample stage within a pipeline. This type combines common [StageOptions](./firestore_pipelines.stageoptions.md#stageoptions_interface) with a specific configuration where only one of the defined sampling methods can be applied.See [Pipeline.sample()](./firestore_pipelines.pipeline.md#pipelinesample) to create a sample stage.. |
+| [SelectStageOptions](./firestore_pipelines.md#selectstageoptions) | (Public Preview) Options defining how a SelectStage is evaluated. See [Pipeline.select()](./firestore_pipelines.pipeline.md#pipelineselect). |
| [SetOptions](./firestore_pipelines.md#setoptions) | An options object that configures the behavior of [setDoc()](./firestore_lite.md#setdoc_ee215ad), and calls. These calls can be configured to perform granular merges instead of overwriting the target documents in their entirety by providing a SetOptions with merge: true. |
-| [SortStageOptions](./firestore_pipelines.md#sortstageoptions) | (Public Preview) Options defining how a SortStage is evaluated. See . |
+| [SortStageOptions](./firestore_pipelines.md#sortstageoptions) | (Public Preview) Options defining how a SortStage is evaluated. See [Pipeline.sort()](./firestore_pipelines.pipeline.md#pipelinesort). |
| [TimeGranularity](./firestore_pipelines.md#timegranularity) | (Public Preview) Specify time granularity for expressions. |
-| [UnionStageOptions](./firestore_pipelines.md#unionstageoptions) | (Public Preview) Options defining how a UnionStage is evaluated. See . |
+| [UnionStageOptions](./firestore_pipelines.md#unionstageoptions) | (Public Preview) Options defining how a UnionStage is evaluated. See [Pipeline.union()](./firestore_pipelines.pipeline.md#pipelineunion). |
| [UnnestStageOptions](./firestore_pipelines.md#unneststageoptions) | (Public Preview) Represents the specific options available for configuring an UnnestStage within a pipeline. |
-| [WhereStageOptions](./firestore_pipelines.md#wherestageoptions) | (Public Preview) Options defining how a WhereStage is evaluated. See . |
+| [WhereStageOptions](./firestore_pipelines.md#wherestageoptions) | (Public Preview) Options defining how a WhereStage is evaluated. See [Pipeline.where()](./firestore_pipelines.pipeline.md#pipelinewhere). |
| [WithFieldValue](./firestore_pipelines.md#withfieldvalue) | Allows FieldValues to be passed in as a property value while maintaining type safety. |
## function()
@@ -1813,13 +392,6 @@ const cityField = field("address.city");
Creates an aggregation that counts the total number of stage inputs.
-```typescript
-// Count the total number of input documents
-countAll().as("totalDocument");
-
-```
- A new representing the 'countAll' aggregation.
-
Signature:
```typescript
@@ -1829,19 +401,23 @@ export declare function countAll(): AggregateFunction;
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### currentTimestamp() {:#currenttimestamp}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'countAll' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that evaluates to the current server timestamp.
```typescript
-// Get the current server timestamp
-currentTimestamp()
+// Count the total number of input documents
+countAll().as("totalDocument");
```
- A new Expression representing the current server timestamp.
+
+### currentTimestamp() {:#currenttimestamp}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that evaluates to the current server timestamp.
Signature:
@@ -1852,6 +428,17 @@ export declare function currentTimestamp(): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new Expression representing the current server timestamp.
+
+### Example
+
+
+```typescript
+// Get the current server timestamp
+currentTimestamp()
+
+```
+
## function(array, ...)
### arrayContains(array, element) {:#arraycontains_a00ea48}
@@ -1861,12 +448,6 @@ export declare function currentTimestamp(): FunctionExpression;
Creates an expression that checks if an array expression contains a specific element.
-```typescript
-// Check if the 'colors' array contains the value of field 'selectedColor'
-arrayContains(field("colors"), field("selectedColor"));
-
-```
-
Signature:
```typescript
@@ -1878,25 +459,30 @@ export declare function arrayContains(array: Expression, element: Expression): B
| Parameter | Type | Description |
| --- | --- | --- |
| array | [Expression](./firestore_pipelines.expression.md#expression_class) | The array expression to check. |
-| element | [Expression](./firestore_pipelines.expression.md#expression_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. |
+| element | [Expression](./firestore_pipelines.expression.md#expression_class) | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContains(array, element) {:#arraycontains_7328608}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array expression contains a specific element.
```typescript
-// Check if the 'colors' array contains "red"
-arrayContains(field("colors"), "red");
+// Check if the 'colors' array contains the value of field 'selectedColor'
+arrayContains(field("colors"), field("selectedColor"));
```
+### arrayContains(array, element) {:#arraycontains_7328608}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array expression contains a specific element.
+
Signature:
```typescript
@@ -1908,25 +494,30 @@ export declare function arrayContains(array: Expression, element: unknown): Bool
| Parameter | Type | Description |
| --- | --- | --- |
| array | [Expression](./firestore_pipelines.expression.md#expression_class) | The array expression to check. |
-| element | unknown | The element to search for in the array. A new representing the 'array\_contains' comparison. |
+| element | unknown | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContainsAll(array, values) {:#arraycontainsall_c658ad5}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an array expression contains all the specified elements.
```typescript
-// Check if the "tags" array contains all of the values: "SciFi", "Adventure", and the value from field "tag1"
-arrayContainsAll(field("tags"), [field("tag1"), constant("SciFi"), "Adventure"]);
+// Check if the 'colors' array contains "red"
+arrayContains(field("colors"), "red");
```
+### arrayContainsAll(array, values) {:#arraycontainsall_c658ad5}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an array expression contains all the specified elements.
+
Signature:
```typescript
@@ -1938,18 +529,16 @@ export declare function arrayContainsAll(array: Expression, values: ArrayExpression evaluating to an array. |
+| offset | number | The index of the element to return. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### arrayGet(arrayExpression, offsetExpr) {:#arrayget_484550d}
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet(field('tags'), field('favoriteTag'));
+// Return the value in the tags field array at index 1.
+arrayGet(field('tags'), 1);
```
+### arrayGet(arrayExpression, offsetExpr) {:#arrayget_484550d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
@@ -2119,25 +739,31 @@ export declare function arrayGet(arrayExpression: Expression, offsetExpr: Expres
| Parameter | Type | Description |
| --- | --- | --- |
-| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expr evaluating to an array. |
-| offsetExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expr evaluating to the index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expression evaluating to an array. |
+| offsetExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expression evaluating to the index of the element to return. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### join(arrayExpression, delimiterExpression) {:#join_313e6aa}
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join an array of string using the delimiter from the 'separator' field.
-join(array(['foo', 'bar']), field("separator"))
+// Return the value in the tags field array at index specified by field
+// 'favoriteTag'.
+arrayGet(field('tags'), field('favoriteTag'));
+
+```
+
+### join(arrayExpression, delimiterExpression) {:#join_313e6aa}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-```
+Creates an expression that joins the elements of an array into a string.
Signature:
@@ -2150,25 +776,30 @@ export declare function join(arrayExpression: Expression, delimiterExpression: E
| Parameter | Type | Description |
| --- | --- | --- |
| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression that evaluates to an array. |
-| delimiterExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. A new Expression representing the join operation. |
+| delimiterExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
-### join(arrayExpression, delimiter) {:#join_d088d29}
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join(field("tags"), ", ")
+// Join an array of string using the delimiter from the 'separator' field.
+join(array(['foo', 'bar']), field("separator"))
```
+### join(arrayExpression, delimiter) {:#join_d088d29}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2180,12 +811,23 @@ export declare function join(arrayExpression: Expression, delimiter: string): Ex
| Parameter | Type | Description |
| --- | --- | --- |
| arrayExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression that evaluates to an array. |
-| delimiter | string | The string to use as a delimiter. A new Expression representing the join operation. |
+| delimiter | string | The string to use as a delimiter. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new Expression representing the join operation.
+
+### Example
+
+
+```typescript
+// Join the elements of the 'tags' field with a comma and space.
+join(field("tags"), ", ")
+
+```
+
## function(arrayField, ...)
### arrayGet(arrayField, offset) {:#arrayget_3f58471}
@@ -2195,12 +837,6 @@ export declare function join(arrayExpression: Expression, delimiter: string): Ex
Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
-```typescript
-// Return the value in the tags field array at index 1.
-arrayGet('tags', 1);
-
-```
-
Signature:
```typescript
@@ -2212,26 +848,30 @@ export declare function arrayGet(arrayField: string, offset: number): FunctionEx
| Parameter | Type | Description |
| --- | --- | --- |
| arrayField | string | The name of the array field. |
-| offset | number | The index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| offset | number | The index of the element to return. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### arrayGet(arrayField, offsetExpr) {:#arrayget_1904c9a}
+A new `Expression` representing the 'arrayGet' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
```typescript
-// Return the value in the tags field array at index specified by field
-// 'favoriteTag'.
-arrayGet('tags', field('favoriteTag'));
+// Return the value in the tags field array at index 1.
+arrayGet('tags', 1);
```
+### arrayGet(arrayField, offsetExpr) {:#arrayget_1904c9a}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that indexes into an array from the beginning or end and return the element. If the offset exceeds the array length, an error is returned. A negative offset, starts from the end.
+
Signature:
```typescript
@@ -2243,12 +883,24 @@ export declare function arrayGet(arrayField: string, offsetExpr: Expression): Fu
| Parameter | Type | Description |
| --- | --- | --- |
| arrayField | string | The name of the array field. |
-| offsetExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expr evaluating to the index of the element to return. A new Expr representing the 'arrayGet' operation. |
+| offsetExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | An Expression evaluating to the index of the element to return. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the 'arrayGet' operation.
+
+### Example
+
+
+```typescript
+// Return the value in the tags field array at index specified by field
+// 'favoriteTag'.
+arrayGet('tags', field('favoriteTag'));
+
+```
+
## function(arrayFieldName, ...)
### join(arrayFieldName, delimiter) {:#join_478ef36}
@@ -2258,12 +910,6 @@ export declare function arrayGet(arrayField: string, offsetExpr: Expression): Fu
Creates an expression that joins the elements of an array into a string.
-```typescript
-// Join the elements of the 'tags' field with a comma and space.
-join("tags", ", ")
-
-```
-
Signature:
```typescript
@@ -2275,25 +921,30 @@ export declare function join(arrayFieldName: string, delimiter: string): Express
| Parameter | Type | Description |
| --- | --- | --- |
| arrayFieldName | string | The name of the field containing the array. |
-| delimiter | string | The string to use as a delimiter. A new Expression representing the join operation. |
+| delimiter | string | The string to use as a delimiter. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
-### join(arrayFieldName, delimiterExpression) {:#join_829294c}
+A new Expression representing the join operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that joins the elements of an array into a string.
```typescript
-// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
-join('tags', field("separator"))
+// Join the elements of the 'tags' field with a comma and space.
+join("tags", ", ")
```
+### join(arrayFieldName, delimiterExpression) {:#join_829294c}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that joins the elements of an array into a string.
+
Signature:
```typescript
@@ -2305,12 +956,23 @@ export declare function join(arrayFieldName: string, delimiterExpression: Expres
| Parameter | Type | Description |
| --- | --- | --- |
| arrayFieldName | string | The name of the field containing the array. |
-| delimiterExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. A new Expression representing the join operation. |
+| delimiterExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that evaluates to the delimiter string. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new Expression representing the join operation.
+
+### Example
+
+
+```typescript
+// Join the elements of the 'tags' field with the delimiter from the 'separator' field.
+join('tags', field("separator"))
+
+```
+
## function(base, ...)
### pow(base, exponent) {:#pow_e4a9e64}
@@ -2320,12 +982,6 @@ export declare function join(arrayFieldName: string, delimiterExpression: Expres
Creates an expression that returns the value of the base expression raised to the power of the exponent expression.
-```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow(field("base"), field("exponent"));
-
-```
-
Signature:
```typescript
@@ -2337,25 +993,30 @@ export declare function pow(base: Expression, exponent: Expression): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| base | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise to the power of the exponent. |
-| exponent | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### pow(base, exponent) {:#pow_93eae7f}
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of the base expression raised to the power of the exponent.
```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow(field("base"), 2);
+// Raise the value of the 'base' field to the power of the 'exponent' field.
+pow(field("base"), field("exponent"));
```
+### pow(base, exponent) {:#pow_93eae7f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of the base expression raised to the power of the exponent.
+
Signature:
```typescript
@@ -2367,25 +1028,30 @@ export declare function pow(base: Expression, exponent: number): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
| base | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise to the power of the exponent. |
-| exponent | number | The constant value to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | number | The constant value to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### pow(base, exponent) {:#pow_a237721}
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of the base field raised to the power of the exponent expression.
```typescript
-// Raise the value of the 'base' field to the power of the 'exponent' field.
-pow("base", field("exponent"));
+// Raise the value of the 'base' field to the power of 2.
+pow(field("base"), 2);
```
+### pow(base, exponent) {:#pow_a237721}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of the base field raised to the power of the exponent expression.
+
Signature:
```typescript
@@ -2397,25 +1063,30 @@ export declare function pow(base: string, exponent: Expression): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
| base | string | The name of the field to raise to the power of the exponent. |
-| exponent | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### pow(base, exponent) {:#pow_f4d7908}
+A new `Expression` representing the power operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the value of the base field raised to the power of the exponent.
```typescript
-// Raise the value of the 'base' field to the power of 2.
-pow("base", 2);
+// Raise the value of the 'base' field to the power of the 'exponent' field.
+pow("base", field("exponent"));
```
+### pow(base, exponent) {:#pow_f4d7908}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the value of the base field raised to the power of the exponent.
+
Signature:
```typescript
@@ -2427,12 +1098,23 @@ export declare function pow(base: string, exponent: number): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
| base | string | The name of the field to raise to the power of the exponent. |
-| exponent | number | The constant value to raise the base to the power of. A new Expr representing the power operation. |
+| exponent | number | The constant value to raise the base to the power of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the power operation.
+
+### Example
+
+
+```typescript
+// Raise the value of the 'base' field to the power of 2.
+pow("base", 2);
+
+```
+
## function(booleanExpr, ...)
### countIf(booleanExpr) {:#countif_c5b8fb1}
@@ -2442,12 +1124,6 @@ export declare function pow(base: string, exponent: number): FunctionExpression;
Creates an aggregation that counts the number of stage inputs where the provided boolean expression evaluates to true.
-```typescript
-// Count the number of documents where 'is_active' field equals true
-countIf(field("is_active").equal(true)).as("numActiveDocuments");
-
-```
-
Signature:
```typescript
@@ -2466,6 +1142,15 @@ export declare function countIf(booleanExpr: BooleanExpression): AggregateFuncti
A new `AggregateFunction` representing the 'countIf' aggregation.
+### Example
+
+
+```typescript
+// Count the number of documents where 'is_active' field equals true
+countIf(field("is_active").equal(true)).as("numActiveDocuments");
+
+```
+
### not(booleanExpr) {:#not_c5b8fb1}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2473,12 +1158,6 @@ A new `AggregateFunction` representing the 'countIf' aggregation.
Creates an expression that negates a filter condition.
-```typescript
-// Find documents where the 'completed' field is NOT true
-not(equal("completed", true));
-
-```
-
Signature:
```typescript
@@ -2489,12 +1168,23 @@ export declare function not(booleanExpr: BooleanExpression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| booleanExpr | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The filter condition to negate. A new representing the negated filter condition. |
+| booleanExpr | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The filter condition to negate. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the negated filter condition.
+
+### Example
+
+
+```typescript
+// Find documents where the 'completed' field is NOT true
+not(equal("completed", true));
+
+```
+
## function(condition, ...)
### conditional(condition, thenExpr, elseExpr) {:#conditional_07a206d}
@@ -2504,13 +1194,6 @@ export declare function not(booleanExpr: BooleanExpression): BooleanExpression;
Creates a conditional expression that evaluates to a 'then' expression if a condition is true and an 'else' expression if the condition is false.
-```typescript
-// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
-conditional(
- greaterThan("age", 18), constant("Adult"), constant("Minor"));
-
-```
-
Signature:
```typescript
@@ -2523,12 +1206,24 @@ export declare function conditional(condition: BooleanExpression, thenExpr: Expr
| --- | --- | --- |
| condition | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The condition to evaluate. |
| thenExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is true. |
-| elseExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. A new representing the conditional expression. |
+| elseExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to evaluate if the condition is false. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the conditional expression.
+
+### Example
+
+
+```typescript
+// If 'age' is greater than 18, return "Adult"; otherwise, return "Minor".
+conditional(
+ greaterThan("age", 18), constant("Adult"), constant("Minor"));
+
+```
+
## function(documentPath, ...)
### documentId(documentPath) {:#documentid_cef293c}
@@ -2538,13 +1233,6 @@ export declare function conditional(condition: BooleanExpression, thenExpr: Expr
Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(myDocumentReference);
-
-```
- A new representing the documentId operation.
-
Signature:
```typescript
@@ -2561,6 +1249,17 @@ export declare function documentId(documentPath: string | DocumentReference): Fu
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the documentId operation.
+
+### Example
+
+
+```typescript
+// Get the document ID from a path.
+documentId(myDocumentReference);
+
+```
+
## function(documentPathExpr, ...)
### documentId(documentPathExpr) {:#documentid_9a69021}
@@ -2570,13 +1269,6 @@ export declare function documentId(documentPath: string | DocumentReference): Fu
Creates an expression that returns the document ID from a path.
-```typescript
-// Get the document ID from a path.
-documentId(field("__path__"));
-
-```
- A new representing the documentId operation.
-
Signature:
```typescript
@@ -2593,6 +1285,17 @@ export declare function documentId(documentPathExpr: Expression): FunctionExpres
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the documentId operation.
+
+### Example
+
+
+```typescript
+// Get the document ID from a path.
+documentId(field("__path__"));
+
+```
+
## function(element, ...)
### notEqualAny(element, values) {:#notequalany_c2c5bcb}
@@ -2602,12 +1305,6 @@ export declare function documentId(documentPathExpr: Expression): FunctionExpres
Creates an expression that checks if an expression is not equal to any of the provided values or expressions.
-```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny(field("status"), ["pending", field("rejectedStatus")]);
-
-```
-
Signature:
```typescript
@@ -2619,11 +1316,22 @@ export declare function notEqualAny(element: Expression, values: ArrayOrdering for ascending sorting. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to create an ascending ordering for. |
Returns:
[Ordering](./firestore_pipelines.ordering.md#ordering_class)
-### byteLength(expr) {:#bytelength_005f3d4}
+A new `Ordering` for ascending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob.
```typescript
-// Calculate the length of the 'myString' field in bytes.
-byteLength(field("myString"));
+// Sort documents by the 'name' field in lowercase in ascending order
+firestore.pipeline().collection("users")
+ .sort(ascending(field("name").toLower()));
```
+### byteLength(expr) {:#bytelength_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the byte length of a string in UTF-8, or just the length of a Blob.
+
Signature:
```typescript
@@ -2793,12 +1517,23 @@ export declare function byteLength(expr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the string. A new representing the length of the string in bytes. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the string. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string in bytes.
+
+### Example
+
+
+```typescript
+// Calculate the length of the 'myString' field in bytes.
+byteLength(field("myString"));
+
+```
+
### countDistinct(expr) {:#countdistinct_3c28b08}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2816,25 +1551,20 @@ export declare function countDistinct(expr: Expression | string): AggregateFunct
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) \| string | The expression or field to count distinct values of. A new AggregateFunction representing the 'count\_distinct' aggregation. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) \| string | The expression or field to count distinct values of. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
+A new `AggregateFunction` representing the 'count\_distinct' aggregation.
+
### descending(expr) {:#descending_005f3d4}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an that sorts documents in descending order based on an expression.
-
-```typescript
-// Sort documents by the 'name' field in lowercase in descending order
-firestore.pipeline().collection("users")
- .sort(descending(field("name").toLower()));
-
-```
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on an expression.
Signature:
@@ -2846,12 +1576,24 @@ export declare function descending(expr: Expression): Ordering;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to create a descending ordering for. A new Ordering for descending sorting. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to create a descending ordering for. |
Returns:
[Ordering](./firestore_pipelines.ordering.md#ordering_class)
+A new `Ordering` for descending sorting.
+
+### Example
+
+
+```typescript
+// Sort documents by the 'name' field in lowercase in descending order
+firestore.pipeline().collection("users")
+ .sort(descending(field("name").toLower()));
+
+```
+
### floor(expr) {:#floor_005f3d4}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2869,12 +1611,14 @@ export declare function floor(expr: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compute the floor of. A new representing the floor of the numeric value. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compute the floor of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the floor of the numeric value.
+
### timestampToUnixMicros(expr) {:#timestamptounixmicros_005f3d4}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -2882,12 +1626,6 @@ export declare function floor(expr: Expression): FunctionExpression;
Creates an expression that converts a timestamp expression to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
-```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros(field("timestamp"));
-
-```
-
Signature:
```typescript
@@ -2898,25 +1636,30 @@ export declare function timestampToUnixMicros(expr: Expression): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the timestamp. A new representing the number of microseconds since epoch. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the timestamp. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixMillis(expr) {:#timestamptounixmillis_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of microseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis(field("timestamp"));
+// Convert the 'timestamp' field to microseconds since epoch.
+timestampToUnixMicros(field("timestamp"));
```
+### timestampToUnixMillis(expr) {:#timestamptounixmillis_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp expression to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -2927,25 +1670,30 @@ export declare function timestampToUnixMillis(expr: Expression): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the timestamp. A new representing the number of milliseconds since epoch. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the timestamp. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixSeconds(expr) {:#timestamptounixseconds_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of milliseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds(field("timestamp"));
+// Convert the 'timestamp' field to milliseconds since epoch.
+timestampToUnixMillis(field("timestamp"));
```
+### timestampToUnixSeconds(expr) {:#timestamptounixseconds_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp expression to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -2956,25 +1704,30 @@ export declare function timestampToUnixSeconds(expr: Expression): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the timestamp. A new representing the number of seconds since epoch. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the timestamp. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of seconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp(field("microseconds"));
+// Convert the 'timestamp' field to seconds since epoch.
+timestampToUnixSeconds(field("timestamp"));
```
+### unixMicrosToTimestamp(expr) {:#unixmicrostotimestamp_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets an expression as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -2985,25 +1738,30 @@ export declare function unixMicrosToTimestamp(expr: Expression): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the number of microseconds since epoch. A new representing the timestamp. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the number of microseconds since epoch. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp(field("milliseconds"));
+// Interpret the 'microseconds' field as microseconds since epoch.
+unixMicrosToTimestamp(field("microseconds"));
```
+### unixMillisToTimestamp(expr) {:#unixmillistotimestamp_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets an expression as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -3014,25 +1772,30 @@ export declare function unixMillisToTimestamp(expr: Expression): FunctionExpress
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the number of milliseconds since epoch. A new representing the timestamp. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the number of milliseconds since epoch. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_005f3d4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp(field("seconds"));
+// Interpret the 'milliseconds' field as milliseconds since epoch.
+unixMillisToTimestamp(field("milliseconds"));
```
+### unixSecondsToTimestamp(expr) {:#unixsecondstotimestamp_005f3d4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets an expression as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -3043,12 +1806,23 @@ export declare function unixSecondsToTimestamp(expr: Expression): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the number of seconds since epoch. A new representing the timestamp. |
+| expr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the number of seconds since epoch. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
+
+### Example
+
+
+```typescript
+// Interpret the 'seconds' field as seconds since epoch.
+unixSecondsToTimestamp(field("seconds"));
+
+```
+
## function(expression, ...)
### arraySum(expression) {:#arraysum_1138a27}
@@ -3058,12 +1832,6 @@ export declare function unixSecondsToTimestamp(expr: Expression): FunctionExpres
Creates an expression that computes the sum of the elements in an array.
-```typescript
-// Compute the sum of the elements in the 'scores' field.
-arraySum(field("scores"));
-
-```
-
Signature:
```typescript
@@ -3074,25 +1842,30 @@ export declare function arraySum(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric array, which the sum will be computed for. A new Expr representing the sum of the elements in the array. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric array, which the sum will be computed for. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### average(expression) {:#average_1138a27}
+A new `Expression` representing the sum of the elements in the array.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs.
```typescript
-// Calculate the average age of users
-average(field("age")).as("averageAge");
+// Compute the sum of the elements in the 'scores' field.
+arraySum(field("scores"));
```
+### average(expression) {:#average_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the average (mean) of values from an expression across multiple stage inputs.
+
Signature:
```typescript
@@ -3103,25 +1876,30 @@ export declare function average(expression: Expression): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the values to average. A new representing the 'average' aggregation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the values to average. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### ceil(expression) {:#ceil_1138a27}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'average' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the ceiling of a numeric value.
```typescript
-// Compute the ceiling of the 'price' field.
-ceil(field("price"));
+// Calculate the average age of users
+average(field("age")).as("averageAge");
```
+### ceil(expression) {:#ceil_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the ceiling of a numeric value.
+
Signature:
```typescript
@@ -3132,24 +1910,29 @@ export declare function ceil(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the ceiling will be computed for. A new representing the ceiling of the numeric value. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the ceiling will be computed for. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### collectionId(expression) {:#collectionid_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the ceiling of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the collection ID from a path.
```typescript
-// Get the collection ID from a path.
-collectionId(field("__name__"));
+// Compute the ceiling of the 'price' field.
+ceil(field("price"));
+
+```
+
+### collectionId(expression) {:#collectionid_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-```
+Creates an expression that returns the collection ID from a path.
Signature:
@@ -3161,25 +1944,30 @@ export declare function collectionId(expression: Expression): FunctionExpression
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a path, which the collection ID will be extracted from. A new representing the collectionId operation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a path, which the collection ID will be extracted from. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### count(expression) {:#count_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the collectionId operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression.
```typescript
-// Count the number of items where the price is greater than 10
-count(field("price").greaterThan(10)).as("expensiveItemCount");
+// Get the collection ID from a path.
+collectionId(field("__name__"));
```
+### count(expression) {:#count_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of stage inputs with valid evaluations of the provided expression.
+
Signature:
```typescript
@@ -3190,25 +1978,30 @@ export declare function count(expression: Expression): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to count. A new representing the 'count' aggregation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to count. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### divide(expression, value) {:#divide_01df3cf}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'count' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides an expression by a constant value.
```typescript
-// Divide the 'value' field by 10
-divide(field("value"), 10);
+// Count the number of items where the price is greater than 10
+count(field("price").greaterThan(10)).as("expensiveItemCount");
```
+### divide(expression, value) {:#divide_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides an expression by a constant value.
+
Signature:
```typescript
@@ -3220,25 +2013,30 @@ export declare function divide(expression: Expression, value: unknown): Function
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to be divided. |
-| value | unknown | The constant value to divide by. A new representing the division operation. |
+| value | unknown | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### equal(expression, value) {:#equal_01df3cf}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is equal to a constant value.
```typescript
-// Check if the 'age' field is equal to 21
-equal(field("age"), 21);
+// Divide the 'value' field by 10
+divide(field("value"), 10);
```
+### equal(expression, value) {:#equal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is equal to a constant value.
+
Signature:
```typescript
@@ -3250,25 +2048,30 @@ export declare function equal(expression: Expression, value: unknown): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the equality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### equalAny(expression, values) {:#equalany_7e759b5}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions.
```typescript
-// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
-equalAny(field("category"), [constant("Electronics"), field("primaryType")]);
+// Check if the 'age' field is equal to 21
+equal(field("age"), 21);
```
+### equalAny(expression, values) {:#equalany_7e759b5}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression, when evaluated, is equal to any of the provided values or expressions.
+
Signature:
```typescript
@@ -3280,25 +2083,30 @@ export declare function equalAny(expression: Expression, values: ArrayExpr representing the greater than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(expression, value) {:#greaterthanorequal_01df3cf}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is greater than or equal to a constant value.
```typescript
-// Check if the 'quantity' field is greater than or equal to 10
-greaterThanOrEqual(field("quantity"), 10);
+// Check if the 'age' field is greater than 18
+greaterThan(field("age"), 18);
```
+### greaterThanOrEqual(expression, value) {:#greaterthanorequal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is greater than or equal to a constant value.
+
Signature:
```typescript
@@ -3400,28 +2222,30 @@ export declare function greaterThanOrEqual(expression: Expression, value: unknow
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the greater than or equal to comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### length\_2(expression) {:#length_2_1138a27}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string, array, map, vector, or bytes.
```typescript
-// Get the length of the 'name' field.
-length(field("name"));
-
-// Get the number of items in the 'cart' array.
-length(field("cart"));
+// Check if the 'quantity' field is greater than or equal to 10
+greaterThanOrEqual(field("quantity"), 10);
```
+### length\_2(expression) {:#length_2_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string, array, map, vector, or bytes.
+
Signature:
```typescript
@@ -3432,25 +2256,33 @@ declare function length_2(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a string, array, map, vector, or bytes, which the length will be calculated for. A new Expr representing the length of the string, array, map, vector, or bytes. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a string, array, map, vector, or bytes, which the length will be calculated for. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### lessThan(expression, value) {:#lessthan_01df3cf}
+A new `Expression` representing the length of the string, array, map, vector, or bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is less than a constant value.
```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), 30);
+// Get the length of the 'name' field.
+length(field("name"));
+
+// Get the number of items in the 'cart' array.
+length(field("cart"));
```
+### lessThan(expression, value) {:#lessthan_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is less than a constant value.
+
Signature:
```typescript
@@ -3462,25 +2294,30 @@ export declare function lessThan(expression: Expression, value: unknown): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(expression, value) {:#lessthanorequal_01df3cf}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is less than or equal to a constant value.
```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), 20);
+// Check if the 'age' field is less than 30
+lessThan(field("age"), 30);
```
+### lessThanOrEqual(expression, value) {:#lessthanorequal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is less than or equal to a constant value.
+
Signature:
```typescript
@@ -3492,25 +2329,30 @@ export declare function lessThanOrEqual(expression: Expression, value: unknown):
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than or equal to comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### ln(expression) {:#ln_1138a27}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the natural logarithm of a numeric value.
```typescript
-// Compute the natural logarithm of the 'value' field.
-ln(field("value"));
+// Check if the 'quantity' field is less than or equal to 20
+lessThan(field("quantity"), 20);
```
+### ln(expression) {:#ln_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the natural logarithm of a numeric value.
+
Signature:
```typescript
@@ -3521,25 +2363,30 @@ export declare function ln(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the natural logarithm will be computed for. A new Expr representing the natural logarithm of the numeric value. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the natural logarithm will be computed for. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### log(expression, base) {:#log_ac183e2}
+A new `Expression` representing the natural logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of an expression to a given base.
```typescript
-// Compute the logarithm of the 'value' field with base 10.
-log(field("value"), 10);
+// Compute the natural logarithm of the 'value' field.
+ln(field("value"));
```
+### log(expression, base) {:#log_ac183e2}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of an expression to a given base.
+
Signature:
```typescript
@@ -3551,25 +2398,30 @@ export declare function log(expression: Expression, base: number): FunctionExpre
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the logarithm will be computed for. |
-| base | number | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| base | number | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### log(expression, base) {:#log_1894737}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of an expression to a given base.
```typescript
-// Compute the logarithm of the 'value' field with the base in the 'base' field.
-log(field("value"), field("base"));
+// Compute the logarithm of the 'value' field with base 10.
+log(field("value"), 10);
```
+### log(expression, base) {:#log_1894737}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of an expression to a given base.
+
Signature:
```typescript
@@ -3581,25 +2433,30 @@ export declare function log(expression: Expression, base: Expression): FunctionE
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the logarithm will be computed for. |
-| base | [Expression](./firestore_pipelines.expression.md#expression_class) | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| base | [Expression](./firestore_pipelines.expression.md#expression_class) | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### log10(expression) {:#log10_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the base-10 logarithm of a numeric value.
```typescript
-// Compute the base-10 logarithm of the 'value' field.
-log10(field("value"));
+// Compute the logarithm of the 'value' field with the base in the 'base' field.
+log(field("value"), field("base"));
```
+### log10(expression) {:#log10_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the base-10 logarithm of a numeric value.
+
Signature:
```typescript
@@ -3610,11 +2467,22 @@ export declare function log10(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the base-10 logarithm will be computed for. A new Expr representing the base-10 logarithm of the numeric value. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the base-10 logarithm will be computed for. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new `Expression` representing the base-10 logarithm of the numeric value.
+
+### Example
+
+
+```typescript
+// Compute the base-10 logarithm of the 'value' field.
+log10(field("value"));
+
+```
### maximum(expression) {:#maximum_1138a27}
@@ -3623,12 +2491,6 @@ export declare function log10(expression: Expression): FunctionExpression;
Creates an aggregation that finds the maximum value of an expression across multiple stage inputs.
-```typescript
-// Find the highest score in a leaderboard
-maximum(field("score")).as("highestScore");
-
-```
-
Signature:
```typescript
@@ -3639,25 +2501,30 @@ export declare function maximum(expression: Expression): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to find the maximum value of. A new representing the 'maximum' aggregation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to find the maximum value of. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### minimum(expression) {:#minimum_1138a27}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'maximum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that finds the minimum value of an expression across multiple stage inputs.
```typescript
-// Find the lowest price of all products
-minimum(field("price")).as("lowestPrice");
+// Find the highest score in a leaderboard
+maximum(field("score")).as("highestScore");
```
+### minimum(expression) {:#minimum_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that finds the minimum value of an expression across multiple stage inputs.
+
Signature:
```typescript
@@ -3668,25 +2535,30 @@ export declare function minimum(expression: Expression): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to find the minimum value of. A new representing the 'minimum' aggregation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to find the minimum value of. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### mod(expression, value) {:#mod_01df3cf}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'minimum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant.
```typescript
-// Calculate the remainder of dividing 'field1' by 5.
-mod(field("field1"), 5);
+// Find the lowest price of all products
+minimum(field("price")).as("lowestPrice");
```
+### mod(expression, value) {:#mod_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the modulo (remainder) of dividing an expression by a constant.
+
Signature:
```typescript
@@ -3698,25 +2570,30 @@ export declare function mod(expression: Expression, value: unknown): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The dividend expression. |
-| value | unknown | The divisor constant. A new representing the modulo operation. |
+| value | unknown | The divisor constant. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### notEqual(expression, value) {:#notequal_01df3cf}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the modulo operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if an expression is not equal to a constant value.
```typescript
-// Check if the 'status' field is not equal to "completed"
-notEqual(field("status"), "completed");
+// Calculate the remainder of dividing 'field1' by 5.
+mod(field("field1"), 5);
```
+### notEqual(expression, value) {:#notequal_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if an expression is not equal to a constant value.
+
Signature:
```typescript
@@ -3728,25 +2605,30 @@ export declare function notEqual(expression: Expression, value: unknown): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the inequality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### round(expression) {:#round_1138a27}
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the nearest whole number.
```typescript
-// Round the value of the 'price' field.
-round(field("price"));
+// Check if the 'status' field is not equal to "completed"
+notEqual(field("status"), "completed");
```
+### round(expression) {:#round_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the nearest whole number.
+
Signature:
```typescript
@@ -3757,25 +2639,30 @@ export declare function round(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which will be rounded. A new Expr representing the rounded value. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which will be rounded. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### round(expression, decimalPlaces) {:#round_a3a92d0}
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the specified number of decimal places.
```typescript
-// Round the value of the 'price' field to two decimal places.
-round(field("price"), constant(2));
+// Round the value of the 'price' field.
+round(field("price"));
```
+### round(expression, decimalPlaces) {:#round_a3a92d0}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the specified number of decimal places.
+
Signature:
```typescript
@@ -3787,12 +2674,23 @@ export declare function round(expression: Expression, decimalPlaces: number | Ex
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which will be rounded. |
-| decimalPlaces | number \| [Expression](./firestore_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | number \| [Expression](./firestore_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the rounded value.
+
+### Example
+
+
+```typescript
+// Round the value of the 'price' field to two decimal places.
+round(field("price"), constant(2));
+
+```
+
### split(expression, delimiter) {:#split_5b5612b}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3811,12 +2709,14 @@ export declare function split(expression: Expression, delimiter: string): Functi
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | Split the result of this expression. |
-| delimiter | string | Split on this delimiter. A new representing the split function. |
+| delimiter | string | Split on this delimiter. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3844,12 +2744,14 @@ export declare function split(expression: Expression, delimiter: Expression): Fu
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | Split the result of this expression. |
-| delimiter | [Expression](./firestore_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. A new representing the split function. |
+| delimiter | [Expression](./firestore_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -3866,12 +2768,6 @@ split(field('scores'), conditional(field('format').equal('csv'), constant(','),
Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt(field("value"));
-
-```
-
Signature:
```typescript
@@ -3882,25 +2778,30 @@ export declare function sqrt(expression: Expression): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the square root will be computed for. A new representing the square root of the numeric value. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluating to a numeric value, which the square root will be computed for. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### subtract(expression, value) {:#subtract_01df3cf}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the square root of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a constant value from an expression.
```typescript
-// Subtract the constant value 2 from the 'value' field
-subtract(field("value"), 2);
+// Compute the square root of the 'value' field.
+sqrt(field("value"));
```
+### subtract(expression, value) {:#subtract_01df3cf}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a constant value from an expression.
+
Signature:
```typescript
@@ -3912,25 +2813,30 @@ export declare function subtract(expression: Expression, value: unknown): Functi
| Parameter | Type | Description |
| --- | --- | --- |
| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract from. |
-| value | unknown | The constant value to subtract. A new representing the subtraction operation. |
+| value | unknown | The constant value to subtract. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### sum(expression) {:#sum_1138a27}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs.
```typescript
-// Calculate the total revenue from a set of orders
-sum(field("orderAmount")).as("totalRevenue");
+// Subtract the constant value 2 from the 'value' field
+subtract(field("value"), 2);
```
+### sum(expression) {:#sum_1138a27}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the sum of values from an expression across multiple stage inputs.
+
Signature:
```typescript
@@ -3941,12 +2847,23 @@ export declare function sum(expression: Expression): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to sum up. A new representing the 'sum' aggregation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to sum up. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'sum' aggregation.
+
+### Example
+
+
+```typescript
+// Calculate the total revenue from a set of orders
+sum(field("orderAmount")).as("totalRevenue");
+
+```
+
### type(expression) {:#type_1138a27}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -3970,6 +2887,8 @@ export declare function type(expression: Expression): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the data type.
+
### Example
@@ -3978,7 +2897,6 @@ export declare function type(expression: Expression): FunctionExpression;
type(conditional(exists('foo'), constant(1), constant(true)))
```
- A new {Expression} representing the data type.
## function(field, ...)
@@ -3989,12 +2907,6 @@ type(conditional(exists('foo'), constant(1), constant(true)))
Creates an expression that returns `true` if a field is absent. Otherwise, returns `false` even if the field value is `null`.
-```typescript
-// Check if the field `value` is absent.
-isAbsent("value");
-
-```
-
Signature:
```typescript
@@ -4005,25 +2917,30 @@ export declare function isAbsent(field: string): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| field | string | The field to check. A new representing the 'isAbsent' check. |
+| field | string | The field to check. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### reverse(field) {:#reverse_0fb8cd4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'isAbsent' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses a string value in the specified field.
```typescript
-// Reverse the value of the 'myString' field.
-reverse("myString");
+// Check if the field `value` is absent.
+isAbsent("value");
```
+### reverse(field) {:#reverse_0fb8cd4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses a string value in the specified field.
+
Signature:
```typescript
@@ -4034,25 +2951,30 @@ export declare function reverse(field: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| field | string | The name of the field representing the string to reverse. A new representing the reversed string. |
+| field | string | The name of the field representing the string to reverse. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### stringReverse(field) {:#stringreverse_0fb8cd4}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that reverses a string value in the specified field.
```typescript
// Reverse the value of the 'myString' field.
-strReverse("myString");
+reverse("myString");
```
+### stringReverse(field) {:#stringreverse_0fb8cd4}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that reverses a string value in the specified field.
+
Signature:
```typescript
@@ -4063,12 +2985,23 @@ export declare function stringReverse(field: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| field | string | The name of the field representing the string to reverse. A new representing the reversed string. |
+| field | string | The name of the field representing the string to reverse. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the reversed string.
+
+### Example
+
+
+```typescript
+// Reverse the value of the 'myString' field.
+strReverse("myString");
+
+```
+
### substring(field, position, length) {:#substring_0d9573a}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -4138,12 +3071,14 @@ export declare function abs(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field to compute the absolute value of. A new representing the absolute value of the numeric value. |
+| fieldName | string | The field to compute the absolute value of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the absolute value of the numeric value.
+
### add(fieldName, second) {:#add_b75bb8b}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -4151,12 +3086,6 @@ export declare function abs(fieldName: string): FunctionExpression;
Creates an expression that adds a field's value to an expression.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add("quantity", field("reserve"));
-
-```
-
Signature:
```typescript
@@ -4174,6 +3103,17 @@ export declare function add(fieldName: string, second: Expression | unknown): Fu
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the addition operation.
+
+### Example
+
+
+```typescript
+// Add the value of the 'quantity' field and the 'reserve' field.
+add("quantity", field("reserve"));
+
+```
+
### arrayContains(fieldName, element) {:#arraycontains_aaace4a}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -4181,16 +3121,45 @@ export declare function add(fieldName: string, second: Expression | unknown): Fu
Creates an expression that checks if a field's array value contains a specific element.
+Signature:
+
+```typescript
+export declare function arrayContains(fieldName: string, element: Expression): BooleanExpression;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| fieldName | string | The field name to check. |
+| element | [Expression](./firestore_pipelines.expression.md#expression_class) | The element to search for in the array. |
+
+Returns:
+
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
+
+### Example
+
+
```typescript
// Check if the 'colors' array contains the value of field 'selectedColor'
arrayContains("colors", field("selectedColor"));
```
+### arrayContains(fieldName, element) {:#arraycontains_999590f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's array value contains a specific value.
+
Signature:
```typescript
-export declare function arrayContains(fieldName: string, element: Expression): BooleanExpression;
+export declare function arrayContains(fieldName: string, element: unknown): BooleanExpression;
```
#### Parameters
@@ -4198,29 +3167,34 @@ export declare function arrayContains(fieldName: string, element: Expression): B
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| element | [Expression](./firestore_pipelines.expression.md#expression_class) | The element to search for in the array. A new representing the 'array\_contains' comparison. |
+| element | unknown | The element to search for in the array. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### arrayContains(fieldName, element) {:#arraycontains_999590f}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'array\_contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's array value contains a specific value.
```typescript
// Check if the 'colors' array contains "red"
arrayContains("colors", "red");
-```
+```
+
+### arrayContainsAll(fieldName, values) {:#arraycontainsall_8060b23}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's array value contains all the specified values or expressions.
Signature:
```typescript
-export declare function arrayContains(fieldName: string, element: unknown): BooleanExpression;
+export declare function arrayContainsAll(fieldName: string, values: ArrayExpr representing the sum of the elements in the array. |
+| fieldName | string | The field to create an ascending ordering for. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[Ordering](./firestore_pipelines.ordering.md#ordering_class)
-### ascending(fieldName) {:#ascending_e5b0480}
+A new `Ordering` for ascending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an that sorts documents in ascending order based on a field.
```typescript
// Sort documents by the 'name' field in ascending order
@@ -4428,28 +3429,33 @@ firestore.pipeline().collection("users")
```
+### average(fieldName) {:#average_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs.
+
Signature:
```typescript
-export declare function ascending(fieldName: string): Ordering;
+export declare function average(fieldName: string): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field to create an ascending ordering for. A new Ordering for ascending sorting. |
+| fieldName | string | The name of the field containing numeric values to average. |
Returns:
-[Ordering](./firestore_pipelines.ordering.md#ordering_class)
+[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### average(fieldName) {:#average_e5b0480}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'average' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the average (mean) of a field's values across multiple stage inputs.
```typescript
// Calculate the average age of users
@@ -4457,28 +3463,33 @@ average("age").as("averageAge");
```
+### byteLength(fieldName) {:#bytelength_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.
+
Signature:
```typescript
-export declare function average(fieldName: string): AggregateFunction;
+export declare function byteLength(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing numeric values to average. A new representing the 'average' aggregation. |
+| fieldName | string | The name of the field containing the string. |
Returns:
-[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### byteLength(fieldName) {:#bytelength_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string in bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string represented by a field in UTF-8 bytes, or just the length of a Blob.
```typescript
// Calculate the length of the 'myString' field in bytes.
@@ -4486,28 +3497,33 @@ byteLength("myString");
```
+### ceil(fieldName) {:#ceil_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the ceiling of a numeric value.
+
Signature:
```typescript
-export declare function byteLength(fieldName: string): FunctionExpression;
+export declare function ceil(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the length of the string in bytes. |
+| fieldName | string | The name of the field to compute the ceiling of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### ceil(fieldName) {:#ceil_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the ceiling of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the ceiling of a numeric value.
```typescript
// Compute the ceiling of the 'price' field.
@@ -4515,28 +3531,33 @@ ceil("price");
```
+### charLength(fieldName) {:#charlength_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the character length of a string field in UTF8.
+
Signature:
```typescript
-export declare function ceil(fieldName: string): FunctionExpression;
+export declare function charLength(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the ceiling of. A new representing the ceiling of the numeric value. |
+| fieldName | string | The name of the field containing the string. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### charLength(fieldName) {:#charlength_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the character length of a string field in UTF8.
```typescript
// Get the character length of the 'name' field in UTF-8.
@@ -4544,28 +3565,33 @@ strLength("name");
```
+### collectionId(fieldName) {:#collectionid_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the collection ID from a path.
+
Signature:
```typescript
-export declare function charLength(fieldName: string): FunctionExpression;
+export declare function collectionId(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the length of the string. |
+| fieldName | string | The name of the field to get the collection ID from. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### collectionId(fieldName) {:#collectionid_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the collectionId operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the collection ID from a path.
```typescript
// Get the collection ID from a path.
@@ -4573,28 +3599,35 @@ collectionId("__name__");
```
+### concat(fieldName, second, others) {:#concat_828272e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
+
Signature:
```typescript
-export declare function collectionId(fieldName: string): FunctionExpression;
+export declare function concat(fieldName: string, second: Expression | unknown, ...others: ArrayExpression representing the concatenation. |
+| fieldName | string | The name of the field containing the first vector. |
+| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles) or [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### cosineDistance(fieldName, vector) {:#cosinedistance_463a23e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between a field's vector value and a literal vector value.
```typescript
// Calculate the Cosine distance between the 'location' field and a target location
@@ -4633,10 +3670,17 @@ cosineDistance("location", [37.7749, -122.4194]);
```
+### cosineDistance(fieldName, vectorExpression) {:#cosinedistance_ed766a1}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Cosine distance between a field's vector value and a vector expression.
+
Signature:
```typescript
-export declare function cosineDistance(fieldName: string, vector: number[] | VectorValue): FunctionExpression;
+export declare function cosineDistance(fieldName: string, vectorExpression: Expression): FunctionExpression;
```
#### Parameters
@@ -4644,18 +3688,16 @@ export declare function cosineDistance(fieldName: string, vector: number[] | Vec
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the first vector. |
-| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles) or [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) to compare against. A new representing the Cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### cosineDistance(fieldName, vectorExpression) {:#cosinedistance_ed766a1}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between a field's vector value and a vector expression.
```typescript
// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
@@ -4663,29 +3705,33 @@ cosineDistance("userVector", field("itemVector"));
```
+### count(fieldName) {:#count_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that counts the number of stage inputs where the input field exists.
+
Signature:
```typescript
-export declare function cosineDistance(fieldName: string, vectorExpression: Expression): FunctionExpression;
+export declare function count(fieldName: string): AggregateFunction;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the first vector. |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. |
+| fieldName | string | The name of the field to count. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### count(fieldName) {:#count_e5b0480}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'count' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that counts the number of stage inputs where the input field exists.
```typescript
// Count the total number of products
@@ -4693,28 +3739,33 @@ count("productId").as("totalProducts");
```
+### descending(fieldName) {:#descending_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an [Ordering](./firestore_pipelines.ordering.md#ordering_class) that sorts documents in descending order based on a field.
+
Signature:
```typescript
-export declare function count(fieldName: string): AggregateFunction;
+export declare function descending(fieldName: string): Ordering;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to count. A new representing the 'count' aggregation. |
+| fieldName | string | The field to create a descending ordering for. |
Returns:
-[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
+[Ordering](./firestore_pipelines.ordering.md#ordering_class)
-### descending(fieldName) {:#descending_e5b0480}
+A new `Ordering` for descending sorting.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an that sorts documents in descending order based on a field.
```typescript
// Sort documents by the 'name' field in descending order
@@ -4723,28 +3774,34 @@ firestore.pipeline().collection("users")
```
+### divide(fieldName, expressions) {:#divide_cf36e43}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides a field's value by an expression.
+
Signature:
```typescript
-export declare function descending(fieldName: string): Ordering;
+export declare function divide(fieldName: string, expressions: Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field to create a descending ordering for. A new Ordering for descending sorting. |
+| fieldName | string | The field name to be divided. |
+| expressions | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to divide by. |
Returns:
-[Ordering](./firestore_pipelines.ordering.md#ordering_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### divide(fieldName, expressions) {:#divide_cf36e43}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides a field's value by an expression.
```typescript
// Divide the 'total' field by the 'count' field
@@ -4752,10 +3809,17 @@ divide("total", field("count"));
```
+### divide(fieldName, value) {:#divide_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that divides a field's value by a constant value.
+
Signature:
```typescript
-export declare function divide(fieldName: string, expressions: Expression): FunctionExpression;
+export declare function divide(fieldName: string, value: unknown): FunctionExpression;
```
#### Parameters
@@ -4763,18 +3827,16 @@ export declare function divide(fieldName: string, expressions: Expression): Func
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to be divided. |
-| expressions | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to divide by. A new representing the division operation. |
+| value | unknown | The constant value to divide by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### divide(fieldName, value) {:#divide_65e2f32}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that divides a field's value by a constant value.
```typescript
// Divide the 'value' field by 10
@@ -4782,29 +3844,34 @@ divide("value", 10);
```
+### dotProduct(fieldName, vector) {:#dotproduct_463a23e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between a field's vector value and a double array.
+
Signature:
```typescript
-export declare function divide(fieldName: string, value: unknown): FunctionExpression;
+export declare function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to be divided. |
-| value | unknown | The constant value to divide by. A new representing the division operation. |
+| fieldName | string | The name of the field containing the first vector. |
+| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(fieldName, vector) {:#dotproduct_463a23e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between a field's vector value and a double array.
```typescript
// Calculate the dot product distance between a feature vector and a target vector
@@ -4812,10 +3879,17 @@ dotProduct("features", [0.5, 0.8, 0.2]);
```
+### dotProduct(fieldName, vectorExpression) {:#dotproduct_ed766a1}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between a field's vector value and a vector expression.
+
Signature:
```typescript
-export declare function dotProduct(fieldName: string, vector: number[] | VectorValue): FunctionExpression;
+export declare function dotProduct(fieldName: string, vectorExpression: Expression): FunctionExpression;
```
#### Parameters
@@ -4823,18 +3897,16 @@ export declare function dotProduct(fieldName: string, vector: number[] | VectorV
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the first vector. |
-| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. A new representing the dot product between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to calculate with. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(fieldName, vectorExpression) {:#dotproduct_ed766a1}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between a field's vector value and a vector expression.
```typescript
// Calculate the dot product distance between two document vectors: 'docVector1' and 'docVector2'
@@ -4842,29 +3914,34 @@ dotProduct("docVector1", field("docVector2"));
```
+### endsWith(fieldName, suffix) {:#endswith_05ca3b0}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value ends with a given postfix.
+
Signature:
```typescript
-export declare function dotProduct(fieldName: string, vectorExpression: Expression): FunctionExpression;
+export declare function endsWith(fieldName: string, suffix: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the first vector. |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. |
+| fieldName | string | The field name to check. |
+| suffix | string | The postfix to check for. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### endsWith(fieldName, suffix) {:#endswith_05ca3b0}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value ends with a given postfix.
```typescript
// Check if the 'filename' field ends with ".txt"
@@ -4872,10 +3949,17 @@ endsWith("filename", ".txt");
```
+### endsWith(fieldName, suffix) {:#endswith_8fc0ebc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value ends with a given postfix.
+
Signature:
```typescript
-export declare function endsWith(fieldName: string, suffix: string): BooleanExpression;
+export declare function endsWith(fieldName: string, suffix: Expression): BooleanExpression;
```
#### Parameters
@@ -4883,18 +3967,16 @@ export declare function endsWith(fieldName: string, suffix: string): BooleanExpr
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| suffix | string | The postfix to check for. A new representing the 'ends with' comparison. |
+| suffix | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the postfix. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### endsWith(fieldName, suffix) {:#endswith_8fc0ebc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'ends with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value ends with a given postfix.
```typescript
// Check if the 'url' field ends with the value of the 'extension' field
@@ -4902,29 +3984,34 @@ endsWith("url", field("extension"));
```
+### equal(fieldName, expression) {:#equal_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to an expression.
+
Signature:
```typescript
-export declare function endsWith(fieldName: string, suffix: Expression): BooleanExpression;
+export declare function equal(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to check. |
-| suffix | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the postfix. A new representing the 'ends with' comparison. |
+| fieldName | string | The field name to compare. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### equal(fieldName, expression) {:#equal_1e91657}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is equal to an expression.
```typescript
// Check if the 'age' field is equal to the 'limit' field
@@ -4932,10 +4019,17 @@ equal("age", field("limit"));
```
+### equal(fieldName, value) {:#equal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to a constant value.
+
Signature:
```typescript
-export declare function equal(fieldName: string, expression: Expression): BooleanExpression;
+export declare function equal(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -4943,18 +4037,16 @@ export declare function equal(fieldName: string, expression: Expression): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the equality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### equal(fieldName, value) {:#equal_65e2f32}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is equal to a constant value.
```typescript
// Check if the 'city' field is equal to string constant "London"
@@ -4962,29 +4054,34 @@ equal("city", "London");
```
+### equalAny(fieldName, values) {:#equalany_8060b23}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
+
Signature:
```typescript
-export declare function equal(fieldName: string, value: unknown): BooleanExpression;
+export declare function equalAny(fieldName: string, values: ArrayExpr representing the equality comparison. |
+| fieldName | string | The field to compare. |
+| values | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | The values to check against. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### equalAny(fieldName, values) {:#equalany_8060b23}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'IN' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
```typescript
// Check if the 'category' field is either "Electronics" or value of field 'primaryType'
@@ -4992,10 +4089,17 @@ equalAny("category", [constant("Electronics"), field("primaryType")]);
```
+### equalAny(fieldName, arrayExpression) {:#equalany_48da8d9}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is equal to any of the provided values or expressions.
+
Signature:
```typescript
-export declare function equalAny(fieldName: string, values: ArrayExpression) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### euclideanDistance(fieldName, vectorExpression) {:#euclideandistance_ed766a1}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between a field's vector value and a vector expression.
```typescript
// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
@@ -5082,29 +4194,33 @@ euclideanDistance("pointA", field("pointB"));
```
+### exists(fieldName) {:#exists_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field exists.
+
Signature:
```typescript
-export declare function euclideanDistance(fieldName: string, vectorExpression: Expression): FunctionExpression;
+export declare function exists(fieldName: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the first vector. |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. |
+| fieldName | string | The field name to check. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### exists(fieldName) {:#exists_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'exists' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field exists.
```typescript
// Check if the document has a field named "phoneNumber"
@@ -5112,81 +4228,93 @@ exists("phoneNumber");
```
+### exp(fieldName) {:#exp_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes e to the power of the expression's result.
+
Signature:
```typescript
-export declare function exists(fieldName: string): BooleanExpression;
+export declare function exp(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to check. A new representing the 'exists' check. |
+| fieldName | string | |
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### exp(fieldName) {:#exp_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the exp of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes e to the power of the expression's result.
```typescript
// Compute e to the power of the 'value' field.
exp('value');
```
- A new representing the exp of the numeric value.
+
+### floor(fieldName) {:#floor_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the floor of a numeric value.
Signature:
```typescript
-export declare function exp(fieldName: string): FunctionExpression;
+export declare function floor(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | |
+| fieldName | string | The name of the field to compute the floor of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### floor(fieldName) {:#floor_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the floor of the numeric value.
+
+### greaterThan(fieldName, expression) {:#greaterthan_1e91657}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Creates an expression that computes the floor of a numeric value.
+Creates an expression that checks if a field's value is greater than an expression.
Signature:
```typescript
-export declare function floor(fieldName: string): FunctionExpression;
+export declare function greaterThan(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the floor of. A new representing the floor of the numeric value. |
+| fieldName | string | The field name to compare. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThan(fieldName, expression) {:#greaterthan_1e91657}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than an expression.
```typescript
// Check if the value of field 'age' is greater than the value of field 'limit'
@@ -5194,10 +4322,17 @@ greaterThan("age", field("limit"));
```
+### greaterThan(fieldName, value) {:#greaterthan_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is greater than a constant value.
+
Signature:
```typescript
-export declare function greaterThan(fieldName: string, expression: Expression): BooleanExpression;
+export declare function greaterThan(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5205,29 +4340,34 @@ export declare function greaterThan(fieldName: string, expression: Expression):
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the greater than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThan(fieldName, value) {:#greaterthan_65e2f32}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than a constant value.
```typescript
// Check if the 'price' field is greater than 100
greaterThan("price", 100);
-```
+```
+
+### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_2e16acb}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is greater than or equal to an expression.
Signature:
```typescript
-export declare function greaterThan(fieldName: string, value: unknown): BooleanExpression;
+export declare function greaterThanOrEqual(fieldName: string, value: Expression): BooleanExpression;
```
#### Parameters
@@ -5235,18 +4375,16 @@ export declare function greaterThan(fieldName: string, value: unknown): BooleanE
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the greater than comparison. |
+| value | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_2e16acb}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than or equal to an expression.
```typescript
// Check if the value of field 'age' is greater than or equal to the value of field 'limit'
@@ -5254,10 +4392,17 @@ greaterThanOrEqual("age", field("limit"));
```
+### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is greater than or equal to a constant value.
+
Signature:
```typescript
-export declare function greaterThanOrEqual(fieldName: string, value: Expression): BooleanExpression;
+export declare function greaterThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5265,18 +4410,16 @@ export declare function greaterThanOrEqual(fieldName: string, value: Expression)
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the greater than or equal to comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(fieldName, value) {:#greaterthanorequal_65e2f32}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is greater than or equal to a constant value.
```typescript
// Check if the 'score' field is greater than or equal to 80
@@ -5284,29 +4427,33 @@ greaterThanOrEqual("score", 80);
```
+### length\_2(fieldName) {:#length_2_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a string, array, map, vector, or bytes.
+
Signature:
```typescript
-export declare function greaterThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
+declare function length_2(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the greater than or equal to comparison. |
+| fieldName | string | The name of the field to calculate the length of. |
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### length\_2(fieldName) {:#length_2_e5b0480}
+A new `Expression` representing the length of the string, array, map, vector, or bytes.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a string, array, map, vector, or bytes.
```typescript
// Get the length of the 'name' field.
@@ -5317,28 +4464,34 @@ length("cart");
```
+### lessThan(fieldName, expression) {:#lessthan_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than an expression.
+
Signature:
```typescript
-declare function length_2(fieldName: string): FunctionExpression;
+export declare function lessThan(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to calculate the length of. A new Expr representing the length of the string, array, map, vector, or bytes. |
+| fieldName | string | The field name to compare. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(fieldName, expression) {:#lessthan_1e91657}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than an expression.
```typescript
// Check if the 'age' field is less than the 'limit' field
@@ -5346,10 +4499,17 @@ lessThan("age", field("limit"));
```
+### lessThan(fieldName, value) {:#lessthan_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than a constant value.
+
Signature:
```typescript
-export declare function lessThan(fieldName: string, expression: Expression): BooleanExpression;
+export declare function lessThan(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5357,18 +4517,16 @@ export declare function lessThan(fieldName: string, expression: Expression): Boo
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the less than comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(fieldName, value) {:#lessthan_65e2f32}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than a constant value.
```typescript
// Check if the 'price' field is less than 50
@@ -5376,10 +4534,17 @@ lessThan("price", 50);
```
+### lessThanOrEqual(fieldName, expression) {:#lessthanorequal_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than or equal to an expression.
+
Signature:
```typescript
-export declare function lessThan(fieldName: string, value: unknown): BooleanExpression;
+export declare function lessThanOrEqual(fieldName: string, expression: Expression): BooleanExpression;
```
#### Parameters
@@ -5387,18 +4552,16 @@ export declare function lessThan(fieldName: string, value: unknown): BooleanExpr
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than comparison. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(fieldName, expression) {:#lessthanorequal_1e91657}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than or equal to an expression.
```typescript
// Check if the 'quantity' field is less than or equal to the 'limit' field
@@ -5406,10 +4569,17 @@ lessThan("quantity", field("limit"));
```
+### lessThanOrEqual(fieldName, value) {:#lessthanorequal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is less than or equal to a constant value.
+
Signature:
```typescript
-export declare function lessThanOrEqual(fieldName: string, expression: Expression): BooleanExpression;
+export declare function lessThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
```
#### Parameters
@@ -5417,18 +4587,16 @@ export declare function lessThanOrEqual(fieldName: string, expression: Expressio
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. A new Expr representing the less than or equal to comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(fieldName, value) {:#lessthanorequal_65e2f32}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is less than or equal to a constant value.
```typescript
// Check if the 'score' field is less than or equal to 70
@@ -5436,29 +4604,34 @@ lessThan("score", 70);
```
+### like(fieldName, pattern) {:#like_67f7432}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive wildcard string comparison against a field.
+
Signature:
```typescript
-export declare function lessThanOrEqual(fieldName: string, value: unknown): BooleanExpression;
+export declare function like(fieldName: string, pattern: string): BooleanExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the less than or equal to comparison. |
+| fieldName | string | The name of the field containing the string. |
+| pattern | string | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### like(fieldName, pattern) {:#like_67f7432}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive wildcard string comparison against a field.
```typescript
// Check if the 'title' field contains the string "guide"
@@ -5466,10 +4639,17 @@ like("title", "%guide%");
```
+### like(fieldName, pattern) {:#like_cb1318d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a case-sensitive wildcard string comparison against a field.
+
Signature:
```typescript
-export declare function like(fieldName: string, pattern: string): BooleanExpression;
+export declare function like(fieldName: string, pattern: Expression): BooleanExpression;
```
#### Parameters
@@ -5477,18 +4657,16 @@ export declare function like(fieldName: string, pattern: string): BooleanExpress
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string. |
-| pattern | string | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. |
+| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### like(fieldName, pattern) {:#like_cb1318d}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'like' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a case-sensitive wildcard string comparison against a field.
```typescript
// Check if the 'title' field contains the string "guide"
@@ -5496,29 +4674,33 @@ like("title", field("pattern"));
```
+### ln(fieldName) {:#ln_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the natural logarithm of a numeric value.
+
Signature:
```typescript
-export declare function like(fieldName: string, pattern: Expression): BooleanExpression;
+export declare function ln(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. |
-| pattern | [Expression](./firestore_pipelines.expression.md#expression_class) | The pattern to search for. You can use "%" as a wildcard character. A new representing the 'like' comparison. |
+| fieldName | string | The name of the field to compute the natural logarithm of. |
Returns:
-[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### ln(fieldName) {:#ln_e5b0480}
+A new `Expression` representing the natural logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the natural logarithm of a numeric value.
```typescript
// Compute the natural logarithm of the 'value' field.
@@ -5526,28 +4708,34 @@ ln("value");
```
+### log(fieldName, base) {:#log_a89e21b}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of a field to a given base.
+
Signature:
```typescript
-export declare function ln(fieldName: string): FunctionExpression;
+export declare function log(fieldName: string, base: number): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the natural logarithm of. A new Expr representing the natural logarithm of the numeric value. |
+| fieldName | string | The name of the field to compute the logarithm of. |
+| base | number | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### log(fieldName, base) {:#log_a89e21b}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of a field to a given base.
```typescript
// Compute the logarithm of the 'value' field with base 10.
@@ -5555,10 +4743,17 @@ log("value", 10);
```
+### log(fieldName, base) {:#log_805b11f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the logarithm of a field to a given base.
+
Signature:
```typescript
-export declare function log(fieldName: string, base: number): FunctionExpression;
+export declare function log(fieldName: string, base: Expression): FunctionExpression;
```
#### Parameters
@@ -5566,18 +4761,16 @@ export declare function log(fieldName: string, base: number): FunctionExpression
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field to compute the logarithm of. |
-| base | number | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| base | [Expression](./firestore_pipelines.expression.md#expression_class) | The base of the logarithm. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### log(fieldName, base) {:#log_805b11f}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the logarithm of a field to a given base.
```typescript
// Compute the logarithm of the 'value' field with the base in the 'base' field.
@@ -5585,29 +4778,33 @@ log("value", field("base"));
```
+### log10(fieldName) {:#log10_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that computes the base-10 logarithm of a numeric value.
+
Signature:
```typescript
-export declare function log(fieldName: string, base: Expression): FunctionExpression;
+export declare function log10(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field to compute the logarithm of. |
-| base | [Expression](./firestore_pipelines.expression.md#expression_class) | The base of the logarithm. A new representing the logarithm of the numeric value. |
+| fieldName | string | The name of the field to compute the base-10 logarithm of. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### log10(fieldName) {:#log10_e5b0480}
+A new `Expression` representing the base-10 logarithm of the numeric value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that computes the base-10 logarithm of a numeric value.
```typescript
// Compute the base-10 logarithm of the 'value' field.
@@ -5615,28 +4812,35 @@ log10("value");
```
+### logicalMaximum(fieldName, second, others) {:#logicalmaximum_828272e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
-export declare function log10(fieldName: string): FunctionExpression;
+export declare function logicalMaximum(fieldName: string, second: Expression | unknown, ...others: ArrayExpr representing the base-10 logarithm of the numeric value. |
+| fieldName | string | The first operand field name. |
+| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The second expression or literal. |
+| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### logicalMaximum(fieldName, second, others) {:#logicalmaximum_828272e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical maximum operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
```typescript
// Returns the largest value between the 'field1' field, the 'field2' field,
@@ -5645,10 +4849,17 @@ logicalMaximum("field1", field("field2"), 1000);
```
+### logicalMinimum(fieldName, second, others) {:#logicalminimum_828272e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the smallest value between a field's value and other input expressions or literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
-export declare function logicalMaximum(fieldName: string, second: Expression | unknown, ...others: ArrayExpr representing the inequality comparison. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### notEqual(fieldName, value) {:#notequal_65e2f32}
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is not equal to a constant value.
```typescript
-// Check if the 'country' field is not equal to "USA"
-notEqual("country", "USA");
+// Check if the 'status' field is not equal to the value of 'expectedStatus'
+notEqual("status", field("expectedStatus"));
```
+### notEqual(fieldName, value) {:#notequal_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is not equal to a constant value.
+
Signature:
```typescript
@@ -5927,25 +5147,30 @@ export declare function notEqual(fieldName: string, value: unknown): BooleanExpr
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to compare. |
-| value | unknown | The constant value to compare to. A new Expr representing the inequality comparison. |
+| value | unknown | The constant value to compare to. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### notEqualAny(fieldName, values) {:#notequalany_8060b23}
+A new `Expression` representing the inequality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value is not equal to any of the provided values or expressions.
```typescript
-// Check if the 'status' field is neither "pending" nor the value of 'rejectedStatus'
-notEqualAny("status", [constant("pending"), field("rejectedStatus")]);
+// Check if the 'country' field is not equal to "USA"
+notEqual("country", "USA");
```
+### notEqualAny(fieldName, values) {:#notequalany_8060b23}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value is not equal to any of the provided values or expressions.
+
Signature:
```typescript
@@ -5957,25 +5182,30 @@ export declare function notEqualAny(fieldName: string, values: ArrayExpr representing the rounded value. |
+| fieldName | string | The name of the field to round. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### round(fieldName, decimalPlaces) {:#round_07d0cf0}
+A new `Expression` representing the rounded value.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that rounds a numeric value to the specified number of decimal places.
```typescript
-// Round the value of the 'price' field to two decimal places.
-round("price", 2);
+// Round the value of the 'price' field.
+round("price");
```
+### round(fieldName, decimalPlaces) {:#round_07d0cf0}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that rounds a numeric value to the specified number of decimal places.
+
Signature:
```typescript
@@ -6166,12 +5426,23 @@ export declare function round(fieldName: string, decimalPlaces: number | Express
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field to round. |
-| decimalPlaces | number \| [Expression](./firestore_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. A new Expr representing the rounded value. |
+| decimalPlaces | number \| [Expression](./firestore_pipelines.expression.md#expression_class) | A constant or expression specifying the rounding precision in decimal places. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the rounded value.
+
+### Example
+
+
+```typescript
+// Round the value of the 'price' field to two decimal places.
+round("price", 2);
+
+```
+
### split(fieldName, delimiter) {:#split_2cfdd37}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -6190,12 +5461,14 @@ export declare function split(fieldName: string, delimiter: string): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | Split the value in this field. |
-| delimiter | string | Split on this delimiter. A new representing the split function. |
+| delimiter | string | Split on this delimiter. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -6223,12 +5496,14 @@ export declare function split(fieldName: string, delimiter: Expression): Functio
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | Split the value in this field. |
-| delimiter | [Expression](./firestore_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. A new representing the split function. |
+| delimiter | [Expression](./firestore_pipelines.expression.md#expression_class) | Split on this delimiter returned by evaluating this expression. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the split function.
+
### Example
@@ -6245,12 +5520,6 @@ split('scores', conditional(field('format').equal('csv'), constant(','), constan
Creates an expression that computes the square root of a numeric value.
-```typescript
-// Compute the square root of the 'value' field.
-sqrt("value");
-
-```
-
Signature:
```typescript
@@ -6259,13 +5528,24 @@ export declare function sqrt(fieldName: string): FunctionExpression;
#### Parameters
-| Parameter | Type | Description |
-| --- | --- | --- |
-| fieldName | string | The name of the field to compute the square root of. A new representing the square root of the numeric value. |
+| Parameter | Type | Description |
+| --- | --- | --- |
+| fieldName | string | The name of the field to compute the square root of. |
+
+Returns:
+
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the square root of the numeric value.
+
+### Example
+
-Returns:
+```typescript
+// Compute the square root of the 'value' field.
+sqrt("value");
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+```
### startsWith(fieldName, prefix) {:#startswith_89325cc}
@@ -6274,12 +5554,6 @@ export declare function sqrt(fieldName: string): FunctionExpression;
Creates an expression that checks if a field's value starts with a given prefix.
-```typescript
-// Check if the 'name' field starts with "Mr."
-startsWith("name", "Mr.");
-
-```
-
Signature:
```typescript
@@ -6291,25 +5565,30 @@ export declare function startsWith(fieldName: string, prefix: string): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| prefix | string | The prefix to check for. A new representing the 'starts with' comparison. |
+| prefix | string | The prefix to check for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### startsWith(fieldName, prefix) {:#startswith_266c338}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a field's value starts with a given prefix.
```typescript
-// Check if the 'fullName' field starts with the value of the 'firstName' field
-startsWith("fullName", field("firstName"));
+// Check if the 'name' field starts with "Mr."
+startsWith("name", "Mr.");
```
+### startsWith(fieldName, prefix) {:#startswith_266c338}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a field's value starts with a given prefix.
+
Signature:
```typescript
@@ -6321,25 +5600,30 @@ export declare function startsWith(fieldName: string, prefix: Expression): Boole
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to check. |
-| prefix | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the prefix. A new representing the 'starts with' comparison. |
+| prefix | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the prefix. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### stringConcat(fieldName, secondString, otherStrings) {:#stringconcat_d80077e}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'starts with' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that concatenates string functions, fields or constants together.
```typescript
-// Combine the 'firstName', " ", and 'lastName' fields into a single string
-stringConcat("firstName", " ", field("lastName"));
+// Check if the 'fullName' field starts with the value of the 'firstName' field
+startsWith("fullName", field("firstName"));
```
+### stringConcat(fieldName, secondString, otherStrings) {:#stringconcat_d80077e}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates string functions, fields or constants together.
+
Signature:
```typescript
@@ -6352,25 +5636,30 @@ export declare function stringConcat(fieldName: string, secondString: Expression
| --- | --- | --- |
| fieldName | string | The field name containing the initial string value. |
| secondString | [Expression](./firestore_pipelines.expression.md#expression_class) \| string | An expression or string literal to concatenate. |
-| otherStrings | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| string> | Optional additional expressions or literals (typically strings) to concatenate. A new representing the concatenated string. |
+| otherStrings | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| string> | Optional additional expressions or literals (typically strings) to concatenate. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### stringContains(fieldName, substring) {:#stringcontains_5b94cfe}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the concatenated string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string field contains a specified substring.
```typescript
-// Check if the 'description' field contains "example".
-stringContains("description", "example");
+// Combine the 'firstName', " ", and 'lastName' fields into a single string
+stringConcat("firstName", " ", field("lastName"));
```
+### stringContains(fieldName, substring) {:#stringcontains_5b94cfe}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string field contains a specified substring.
+
Signature:
```typescript
@@ -6382,25 +5671,30 @@ export declare function stringContains(fieldName: string, substring: string): Bo
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string. |
-| substring | string | The substring to search for. A new representing the 'contains' comparison. |
+| substring | string | The substring to search for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### stringContains(fieldName, substring) {:#stringcontains_ac3ba47}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a string field contains a substring specified by an expression.
```typescript
-// Check if the 'description' field contains the value of the 'keyword' field.
-stringContains("description", field("keyword"));
+// Check if the 'description' field contains "example".
+stringContains("description", "example");
```
+### stringContains(fieldName, substring) {:#stringcontains_ac3ba47}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a string field contains a substring specified by an expression.
+
Signature:
```typescript
@@ -6412,25 +5706,30 @@ export declare function stringContains(fieldName: string, substring: Expression)
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The name of the field containing the string. |
-| substring | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the substring to search for. A new representing the 'contains' comparison. |
+| substring | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the substring to search for. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### subtract(fieldName, expression) {:#subtract_1e91657}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'contains' comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts an expression from a field's value.
```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract("price", field("discount"));
+// Check if the 'description' field contains the value of the 'keyword' field.
+stringContains("description", field("keyword"));
```
+### subtract(fieldName, expression) {:#subtract_1e91657}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts an expression from a field's value.
+
Signature:
```typescript
@@ -6442,25 +5741,30 @@ export declare function subtract(fieldName: string, expression: Expression): Fun
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to subtract from. |
-| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract. A new representing the subtraction operation. |
+| expression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### subtract(fieldName, value) {:#subtract_65e2f32}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a constant value from a field's value.
```typescript
-// Subtract 20 from the value of the 'total' field
-subtract("total", 20);
+// Subtract the 'discount' field from the 'price' field
+subtract("price", field("discount"));
```
+### subtract(fieldName, value) {:#subtract_65e2f32}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a constant value from a field's value.
+
Signature:
```typescript
@@ -6472,25 +5776,30 @@ export declare function subtract(fieldName: string, value: unknown): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| fieldName | string | The field name to subtract from. |
-| value | unknown | The constant value to subtract. A new representing the subtraction operation. |
+| value | unknown | The constant value to subtract. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### sum(fieldName) {:#sum_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an aggregation that calculates the sum of a field's values across multiple stage inputs.
```typescript
-// Calculate the total revenue from a set of orders
-sum("orderAmount").as("totalRevenue");
+// Subtract 20 from the value of the 'total' field
+subtract("total", 20);
```
+### sum(fieldName) {:#sum_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an aggregation that calculates the sum of a field's values across multiple stage inputs.
+
Signature:
```typescript
@@ -6501,25 +5810,30 @@ export declare function sum(fieldName: string): AggregateFunction;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing numeric values to sum up. A new representing the 'sum' aggregation. |
+| fieldName | string | The name of the field containing numeric values to sum up. |
Returns:
[AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class)
-### timestampAdd(fieldName, unit, amount) {:#timestampadd_341fe7d}
+A new [AggregateFunction](./firestore_pipelines.aggregatefunction.md#aggregatefunction_class) representing the 'sum' aggregation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that adds a specified amount of time to a timestamp represented by a field.
```typescript
-// Add 1 day to the 'timestamp' field.
-timestampAdd("timestamp", "day", 1);
+// Calculate the total revenue from a set of orders
+sum("orderAmount").as("totalRevenue");
```
+### timestampAdd(fieldName, unit, amount) {:#timestampadd_341fe7d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that adds a specified amount of time to a timestamp represented by a field.
+
Signature:
```typescript
@@ -6532,25 +5846,30 @@ export declare function timestampAdd(fieldName: string, unit: 'microsecond' | 'm
| --- | --- | --- |
| fieldName | string | The name of the field representing the timestamp. |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to add (e.g., "day", "hour"). |
-| amount | number | The amount of time to add. A new representing the resulting timestamp. |
+| amount | number | The amount of time to add. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### timestampSubtract(fieldName, unit, amount) {:#timestampsubtract_341fe7d}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that subtracts a specified amount of time from a timestamp represented by a field.
```typescript
-// Subtract 1 day from the 'timestamp' field.
-timestampSubtract("timestamp", "day", 1);
+// Add 1 day to the 'timestamp' field.
+timestampAdd("timestamp", "day", 1);
```
+### timestampSubtract(fieldName, unit, amount) {:#timestampsubtract_341fe7d}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts a specified amount of time from a timestamp represented by a field.
+
Signature:
```typescript
@@ -6563,25 +5882,30 @@ export declare function timestampSubtract(fieldName: string, unit: 'microsecond'
| --- | --- | --- |
| fieldName | string | The name of the field representing the timestamp. |
| unit | 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' | The unit of time to subtract (e.g., "day", "hour"). |
-| amount | number | The amount of time to subtract. A new representing the resulting timestamp. |
+| amount | number | The amount of time to subtract. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixMicros(fieldName) {:#timestamptounixmicros_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the resulting timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to microseconds since epoch.
-timestampToUnixMicros("timestamp");
+// Subtract 1 day from the 'timestamp' field.
+timestampSubtract("timestamp", "day", 1);
```
+### timestampToUnixMicros(fieldName) {:#timestamptounixmicros_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp field to the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -6592,25 +5916,30 @@ export declare function timestampToUnixMicros(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the timestamp. A new representing the number of microseconds since epoch. |
+| fieldName | string | The name of the field representing the timestamp. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixMillis(fieldName) {:#timestamptounixmillis_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of microseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to milliseconds since epoch.
-timestampToUnixMillis("timestamp");
+// Convert the 'timestamp' field to microseconds since epoch.
+timestampToUnixMicros("timestamp");
```
+### timestampToUnixMillis(fieldName) {:#timestamptounixmillis_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp field to the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -6621,25 +5950,30 @@ export declare function timestampToUnixMillis(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the timestamp. A new representing the number of milliseconds since epoch. |
+| fieldName | string | The name of the field representing the timestamp. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### timestampToUnixSeconds(fieldName) {:#timestamptounixseconds_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of milliseconds since epoch.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
```typescript
-// Convert the 'timestamp' field to seconds since epoch.
-timestampToUnixSeconds("timestamp");
+// Convert the 'timestamp' field to milliseconds since epoch.
+timestampToUnixMillis("timestamp");
```
+### timestampToUnixSeconds(fieldName) {:#timestamptounixseconds_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a timestamp field to the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC).
+
Signature:
```typescript
@@ -6650,12 +5984,23 @@ export declare function timestampToUnixSeconds(fieldName: string): FunctionExpre
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the timestamp. A new representing the number of seconds since epoch. |
+| fieldName | string | The name of the field representing the timestamp. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the number of seconds since epoch.
+
+### Example
+
+
+```typescript
+// Convert the 'timestamp' field to seconds since epoch.
+timestampToUnixSeconds("timestamp");
+
+```
+
### timestampTruncate(fieldName, granularity, timezone) {:#timestamptruncate_b6c7512}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -6675,12 +6020,14 @@ export declare function timestampTruncate(fieldName: string, granularity: TimeGr
| --- | --- | --- |
| fieldName | string | Truncate the timestamp value contained in this field. |
| granularity | [TimeGranularity](./firestore_pipelines.md#timegranularity) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -6709,12 +6056,14 @@ export declare function timestampTruncate(fieldName: string, granularity: Expres
| --- | --- | --- |
| fieldName | string | Truncate the timestamp value contained in this field. |
| granularity | [Expression](./firestore_pipelines.expression.md#expression_class) | The granularity to truncate to. |
-| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". A new {Expression} representing the truncated timestamp. |
+| timezone | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The timezone to use for truncation. Valid values are from the TZ database (e.g., "America/Los\_Angeles") or in the format "Etc/GMT-1". |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the truncated timestamp.
+
### Example
@@ -6731,34 +6080,60 @@ field('createdAt').timestampTruncate(field('granularity'))
Creates an expression that converts a string field to lowercase.
+Signature:
+
+```typescript
+export declare function toLower(fieldName: string): FunctionExpression;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| fieldName | string | The name of the field containing the string. |
+
+Returns:
+
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the lowercase string.
+
+### Example
+
+
```typescript
// Convert the 'name' field to lowercase
toLower("name");
```
+### toUpper(fieldName) {:#toupper_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that converts a string field to uppercase.
+
Signature:
```typescript
-export declare function toLower(fieldName: string): FunctionExpression;
+export declare function toUpper(fieldName: string): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the lowercase string. |
+| fieldName | string | The name of the field containing the string. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### toUpper(fieldName) {:#toupper_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the uppercase string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that converts a string field to uppercase.
```typescript
// Convert the 'title' field to uppercase
@@ -6766,28 +6141,34 @@ toUpper("title");
```
+### trim(fieldName, valueToTrim) {:#trim_c9f90ee}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that removes leading and trailing whitespace from a string or byte array.
+
Signature:
```typescript
-export declare function toUpper(fieldName: string): FunctionExpression;
+export declare function trim(fieldName: string, valueToTrim?: string | Expression): FunctionExpression;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field containing the string. A new representing the uppercase string. |
+| fieldName | string | The name of the field containing the string or byte array. |
+| valueToTrim | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### trim(fieldName, valueToTrim) {:#trim_c9f90ee}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the trimmed string.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that removes leading and trailing whitespace from a string or byte array.
```typescript
// Trim whitespace from the 'userInput' field
@@ -6798,23 +6179,6 @@ trim("userInput", '"');
```
-Signature:
-
-```typescript
-export declare function trim(fieldName: string, valueToTrim?: string | Expression): FunctionExpression;
-```
-
-#### Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| fieldName | string | The name of the field containing the string or byte array. |
-| valueToTrim | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | Optional This parameter is treated as a set of characters or bytes that will be trimmed from the input. If not specified, then whitespace will be trimmed. A new representing the trimmed string. |
-
-Returns:
-
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-
### type(fieldName) {:#type_e5b0480}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -6838,6 +6202,8 @@ export declare function type(fieldName: string): FunctionExpression;
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new `Expression` representing the data type.
+
### Example
@@ -6846,7 +6212,6 @@ export declare function type(fieldName: string): FunctionExpression;
type('title')
```
- A new {Expression} representing the data type.
### unixMicrosToTimestamp(fieldName) {:#unixmicrostotimestamp_e5b0480}
@@ -6855,12 +6220,6 @@ type('title')
Creates an expression that interprets a field's value as the number of microseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
-```typescript
-// Interpret the 'microseconds' field as microseconds since epoch.
-unixMicrosToTimestamp("microseconds");
-
-```
-
Signature:
```typescript
@@ -6871,25 +6230,30 @@ export declare function unixMicrosToTimestamp(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the number of microseconds since epoch. A new representing the timestamp. |
+| fieldName | string | The name of the field representing the number of microseconds since epoch. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### unixMillisToTimestamp(fieldName) {:#unixmillistotimestamp_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'milliseconds' field as milliseconds since epoch.
-unixMillisToTimestamp("milliseconds");
+// Interpret the 'microseconds' field as microseconds since epoch.
+unixMicrosToTimestamp("microseconds");
```
+### unixMillisToTimestamp(fieldName) {:#unixmillistotimestamp_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets a field's value as the number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -6900,25 +6264,30 @@ export declare function unixMillisToTimestamp(fieldName: string): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the number of milliseconds since epoch. A new representing the timestamp. |
+| fieldName | string | The name of the field representing the number of milliseconds since epoch. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### unixSecondsToTimestamp(fieldName) {:#unixsecondstotimestamp_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
```typescript
-// Interpret the 'seconds' field as seconds since epoch.
-unixSecondsToTimestamp("seconds");
+// Interpret the 'milliseconds' field as milliseconds since epoch.
+unixMillisToTimestamp("milliseconds");
```
+### unixSecondsToTimestamp(fieldName) {:#unixsecondstotimestamp_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that interprets a field's value as the number of seconds since the Unix epoch (1970-01-01 00:00:00 UTC) and returns a timestamp.
+
Signature:
```typescript
@@ -6929,25 +6298,30 @@ export declare function unixSecondsToTimestamp(fieldName: string): FunctionExpre
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the number of seconds since epoch. A new representing the timestamp. |
+| fieldName | string | The name of the field representing the number of seconds since epoch. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### vectorLength(fieldName) {:#vectorlength_e5b0480}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the timestamp.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a Firestore Vector represented by a field.
```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength("embedding");
+// Interpret the 'seconds' field as seconds since epoch.
+unixSecondsToTimestamp("seconds");
```
+### vectorLength(fieldName) {:#vectorlength_e5b0480}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a Firestore Vector represented by a field.
+
Signature:
```typescript
@@ -6958,12 +6332,23 @@ export declare function vectorLength(fieldName: string): FunctionExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| fieldName | string | The name of the field representing the Firestore Vector. A new representing the length of the array. |
+| fieldName | string | The name of the field representing the Firestore Vector. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the array.
+
+### Example
+
+
+```typescript
+// Get the vector length (dimension) of the field 'embedding'.
+vectorLength("embedding");
+
+```
+
## function(first, ...)
### add(first, second) {:#add_846ca1b}
@@ -6973,12 +6358,6 @@ export declare function vectorLength(fieldName: string): FunctionExpression;
Creates an expression that adds two expressions together.
-```typescript
-// Add the value of the 'quantity' field and the 'reserve' field.
-add(field("quantity"), field("reserve"));
-
-```
-
Signature:
```typescript
@@ -6996,20 +6375,24 @@ export declare function add(first: Expression, second: Expression | unknown): Fu
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### and(first, second, more) {:#and_e0c48bd}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the addition operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a logical 'AND' operation on multiple filter conditions.
```typescript
-// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND
-// the 'status' field is "active"
-const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
+// Add the value of the 'quantity' field and the 'reserve' field.
+add(field("quantity"), field("reserve"));
```
+### and(first, second, more) {:#and_e0c48bd}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a logical 'AND' operation on multiple filter conditions.
+
Signature:
```typescript
@@ -7022,25 +6405,31 @@ export declare function and(first: BooleanExpression, second: BooleanExpression,
| --- | --- | --- |
| first | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The first filter condition. |
| second | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The second filter condition. |
-| more | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'AND' together. A new representing the logical 'AND' operation. |
+| more | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'AND' together. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### concat(first, second, others) {:#concat_83be015}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical 'AND' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
```typescript
-// Concatenate the 'firstName' and 'lastName' fields with a space in between.
-concat(field("firstName"), " ", field("lastName"))
+// Check if the 'age' field is greater than 18 AND the 'city' field is "London" AND
+// the 'status' field is "active"
+const condition = and(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
```
+### concat(first, second, others) {:#concat_83be015}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that concatenates strings, arrays, or blobs. Types cannot be mixed.
+
Signature:
```typescript
@@ -7053,26 +6442,30 @@ export declare function concat(first: Expression, second: Expression | unknown,
| --- | --- | --- |
| first | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expressions to concatenate. |
| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The second literal or expression to concatenate. |
-| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Additional literals or expressions to concatenate. A new Expression representing the concatenation. |
+| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Additional literals or expressions to concatenate. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### logicalMaximum(first, second, others) {:#logicalmaximum_83be015}
+A new `Expression` representing the concatenation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
```typescript
-// Returns the largest value between the 'field1' field, the 'field2' field,
-// and 1000
-logicalMaximum(field("field1"), field("field2"), 1000);
+// Concatenate the 'firstName' and 'lastName' fields with a space in between.
+concat(field("firstName"), " ", field("lastName"))
```
+### logicalMaximum(first, second, others) {:#logicalmaximum_83be015}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the largest value between multiple input expressions or literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
@@ -7085,26 +6478,31 @@ export declare function logicalMaximum(first: Expression, second: Expression | u
| --- | --- | --- |
| first | [Expression](./firestore_pipelines.expression.md#expression_class) | The first operand expression. |
| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The second expression or literal. |
-| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. A new representing the logical maximum operation. |
+| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### logicalMinimum(first, second, others) {:#logicalminimum_83be015}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical maximum operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering.
```typescript
-// Returns the smallest value between the 'field1' field, the 'field2' field,
-// and 1000.
-logicalMinimum(field("field1"), field("field2"), 1000);
+// Returns the largest value between the 'field1' field, the 'field2' field,
+// and 1000
+logicalMaximum(field("field1"), field("field2"), 1000);
```
+### logicalMinimum(first, second, others) {:#logicalminimum_83be015}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the smallest value between multiple input expressions and literal values. Based on Firestore's value type ordering.
+
Signature:
```typescript
@@ -7117,25 +6515,31 @@ export declare function logicalMinimum(first: Expression, second: Expression | u
| --- | --- | --- |
| first | [Expression](./firestore_pipelines.expression.md#expression_class) | The first operand expression. |
| second | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The second expression or literal. |
-| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. A new representing the logical minimum operation. |
+| others | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown> | Optional additional expressions or literals. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### multiply(first, second) {:#multiply_846ca1b}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical minimum operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that multiplies two expressions together.
```typescript
-// Multiply the 'quantity' field by the 'price' field
-multiply(field("quantity"), field("price"));
+// Returns the smallest value between the 'field1' field, the 'field2' field,
+// and 1000.
+logicalMinimum(field("field1"), field("field2"), 1000);
```
+### multiply(first, second) {:#multiply_846ca1b}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that multiplies two expressions together.
+
Signature:
```typescript
@@ -7153,20 +6557,24 @@ export declare function multiply(first: Expression, second: Expression | unknown
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### or(first, second, more) {:#or_e0c48bd}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the multiplication operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a logical 'OR' operation on multiple filter conditions.
```typescript
-// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR
-// the 'status' field is "active"
-const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
+// Multiply the 'quantity' field by the 'price' field
+multiply(field("quantity"), field("price"));
```
+### or(first, second, more) {:#or_e0c48bd}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a logical 'OR' operation on multiple filter conditions.
+
Signature:
```typescript
@@ -7179,29 +6587,31 @@ export declare function or(first: BooleanExpression, second: BooleanExpression,
| --- | --- | --- |
| first | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The first filter condition. |
| second | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The second filter condition. |
-| more | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'OR' together. A new representing the logical 'OR' operation. |
+| more | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional filter conditions to 'OR' together. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### xor(first, second, additionalConditions) {:#xor_8197113}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical 'OR' operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions.
```typescript
-// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London",
-// or 'status' is "active".
-const condition = xor(
- greaterThan("age", 18),
- equal("city", "London"),
- equal("status", "active"));
+// Check if the 'age' field is greater than 18 OR the 'city' field is "London" OR
+// the 'status' field is "active"
+const condition = or(greaterThan("age", 18), equal("city", "London"), equal("status", "active"));
```
+### xor(first, second, additionalConditions) {:#xor_8197113}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that performs a logical 'XOR' (exclusive OR) operation on multiple BooleanExpressions.
+
Signature:
```typescript
@@ -7214,12 +6624,27 @@ export declare function xor(first: BooleanExpression, second: BooleanExpression,
| --- | --- | --- |
| first | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The first condition. |
| second | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class) | The second condition. |
-| additionalConditions | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional conditions to 'XOR' together. A new representing the logical 'XOR' operation. |
+| additionalConditions | [BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)\[\] | Additional conditions to 'XOR' together. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the logical 'XOR' operation.
+
+### Example
+
+
+```typescript
+// Check if only one of the conditions is true: 'age' greater than 18, 'city' is "London",
+// or 'status' is "active".
+const condition = xor(
+ greaterThan("age", 18),
+ equal("city", "London"),
+ equal("status", "active"));
+
+```
+
## function(firstArray, ...)
### arrayConcat(firstArray, secondArray, otherArrays) {:#arrayconcat_c00d5d7}
@@ -7229,12 +6654,6 @@ export declare function xor(first: BooleanExpression, second: BooleanExpression,
Creates an expression that concatenates an array expression with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat(field("items"), [field("newItems"), field("otherItems")]);
-
-```
-
Signature:
```typescript
@@ -7247,11 +6666,22 @@ export declare function arrayConcat(firstArray: Expression, secondArray: Express
| --- | --- | --- |
| firstArray | [Expression](./firestore_pipelines.expression.md#expression_class) | The first array expression to concatenate to. |
| secondArray | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown\[\] | The second array expression or array literal to concatenate to. |
-| otherArrays | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. A new representing the concatenated array. |
+| otherArrays | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. |
Returns:
-[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the concatenated array.
+
+### Example
+
+
+```typescript
+// Combine the 'items' array with two new item arrays
+arrayConcat(field("items"), [field("newItems"), field("otherItems")]);
+
+```
## function(firstArrayField, ...)
@@ -7262,12 +6692,6 @@ export declare function arrayConcat(firstArray: Expression, secondArray: Express
Creates an expression that concatenates a field's array value with other arrays.
-```typescript
-// Combine the 'items' array with two new item arrays
-arrayConcat("items", [field("newItems"), field("otherItems")]);
-
-```
-
Signature:
```typescript
@@ -7280,12 +6704,23 @@ export declare function arrayConcat(firstArrayField: string, secondArray: Expres
| --- | --- | --- |
| firstArrayField | string | The first array to concatenate to. |
| secondArray | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown\[\] | The second array expression or array literal to concatenate to. |
-| otherArrays | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. A new representing the concatenated array. |
+| otherArrays | Array<[Expression](./firestore_pipelines.expression.md#expression_class) \| unknown\[\]> | Optional additional array expressions or array literals to concatenate. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the concatenated array.
+
+### Example
+
+
+```typescript
+// Combine the 'items' array with two new item arrays
+arrayConcat("items", [field("newItems"), field("otherItems")]);
+
+```
+
## function(firstMap, ...)
### mapMerge(firstMap, secondMap, otherMaps) {:#mapmerge_cfe77ce}
@@ -7295,13 +6730,6 @@ export declare function arrayConcat(firstArrayField: string, secondArray: Expres
Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge(field('settings'), { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
-
Signature:
```typescript
@@ -7320,6 +6748,16 @@ export declare function mapMerge(firstMap: RecordifExpr evaluates to an absent value. A new \[Expression\] representing the ifAbsent operation. |
+| elseValue | unknown | The value that will be returned if ifExpr evaluates to an absent value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new \[Expression\] representing the ifAbsent operation.
+
+### Example
+
+
+```typescript
+// Returns the value of the optional field 'optional_field', or returns 'default_value'
+// if the field is absent.
+ifAbsent(field("optional_field"), "default_value")
+
+```
+
## function(ifFieldName, ...)
### ifAbsent(ifFieldName, elseExpr) {:#ifabsent_e6dabea}
@@ -7426,13 +6879,6 @@ export declare function ifAbsent(ifExpr: Expression, elseValue: unknown): Expres
Creates an expression that returns the `elseExpr` argument if `ifFieldName` is absent, else return the value of the field.
-```typescript
-// Returns the value of the optional field 'optional_field', or returns the value of
-// 'default_field' if 'optional_field' is absent.
-ifAbsent("optional_field", field("default_field"))
-
-```
-
Signature:
```typescript
@@ -7444,26 +6890,31 @@ export declare function ifAbsent(ifFieldName: string, elseExpr: Expression): Exp
| Parameter | Type | Description |
| --- | --- | --- |
| ifFieldName | string | The field to check for absence. |
-| elseExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that will be evaluated and returned if ifFieldName is absent. A new Expression representing the ifAbsent operation. |
+| elseExpr | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression that will be evaluated and returned if ifFieldName is absent. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
-### ifAbsent(ifFieldName, elseValue) {:#ifabsent_d8f2823}
+A new Expression representing the ifAbsent operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns the `elseValue` argument if `ifFieldName` is absent, else return the value of the field.
```typescript
-// Returns the value of the optional field 'optional_field', or returns 'default_value'
-// if the field is absent.
-ifAbsent("optional_field", "default_value")
+// Returns the value of the optional field 'optional_field', or returns the value of
+// 'default_field' if 'optional_field' is absent.
+ifAbsent("optional_field", field("default_field"))
```
+### ifAbsent(ifFieldName, elseValue) {:#ifabsent_d8f2823}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns the `elseValue` argument if `ifFieldName` is absent, else return the value of the field.
+
Signature:
```typescript
@@ -7475,12 +6926,24 @@ export declare function ifAbsent(ifFieldName: string | Expression, elseValue: Ex
| Parameter | Type | Description |
| --- | --- | --- |
| ifFieldName | string \| [Expression](./firestore_pipelines.expression.md#expression_class) | The field to check for absence. |
-| elseValue | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The value that will be returned if \[ifFieldName\] is absent. A new Expression representing the ifAbsent operation. |
+| elseValue | [Expression](./firestore_pipelines.expression.md#expression_class) \| unknown | The value that will be returned if \[ifFieldName\] is absent. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new Expression representing the ifAbsent operation.
+
+### Example
+
+
+```typescript
+// Returns the value of the optional field 'optional_field', or returns 'default_value'
+// if the field is absent.
+ifAbsent("optional_field", "default_value")
+
+```
+
## function(input, ...)
### substring(input, position, length) {:#substring_e6e0aa3}
@@ -7542,12 +7005,6 @@ export declare function substring(input: Expression, position: Expression, lengt
Creates an expression that divides two expressions.
-```typescript
-// Divide the 'total' field by the 'count' field
-divide(field("total"), field("count"));
-
-```
-
Signature:
```typescript
@@ -7559,25 +7016,30 @@ export declare function divide(left: Expression, right: Expression): FunctionExp
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to be divided. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to divide by. A new representing the division operation. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to divide by. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### equal(left, right) {:#equal_b3c3382}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the division operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if two expressions are equal.
```typescript
-// Check if the 'age' field is equal to an expression
-equal(field("age"), field("minAge").add(10));
+// Divide the 'total' field by the 'count' field
+divide(field("total"), field("count"));
```
+### equal(left, right) {:#equal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if two expressions are equal.
+
Signature:
```typescript
@@ -7589,25 +7051,30 @@ export declare function equal(left: Expression, right: Expression): BooleanExpre
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the equality comparison. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThan(left, right) {:#greaterthan_b3c3382}
+A new `Expression` representing the equality comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is greater than the second expression.
```typescript
-// Check if the 'age' field is greater than 18
-greaterThan(field("age"), Constant(9).add(9));
+// Check if the 'age' field is equal to an expression
+equal(field("age"), field("minAge").add(10));
```
+### greaterThan(left, right) {:#greaterthan_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is greater than the second expression.
+
Signature:
```typescript
@@ -7619,25 +7086,30 @@ export declare function greaterThan(left: Expression, right: Expression): Boolea
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the greater than comparison. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### greaterThanOrEqual(left, right) {:#greaterthanorequal_b3c3382}
+A new `Expression` representing the greater than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is greater than or equal to the second expression.
```typescript
-// Check if the 'quantity' field is greater than or equal to the field "threshold"
-greaterThanOrEqual(field("quantity"), field("threshold"));
+// Check if the 'age' field is greater than 18
+greaterThan(field("age"), Constant(9).add(9));
```
+### greaterThanOrEqual(left, right) {:#greaterthanorequal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is greater than or equal to the second expression.
+
Signature:
```typescript
@@ -7649,25 +7121,30 @@ export declare function greaterThanOrEqual(left: Expression, right: Expression):
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the greater than or equal to comparison. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThan(left, right) {:#lessthan_b3c3382}
+A new `Expression` representing the greater than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is less than the second expression.
```typescript
-// Check if the 'age' field is less than 30
-lessThan(field("age"), field("limit"));
+// Check if the 'quantity' field is greater than or equal to the field "threshold"
+greaterThanOrEqual(field("quantity"), field("threshold"));
```
+### lessThan(left, right) {:#lessthan_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is less than the second expression.
+
Signature:
```typescript
@@ -7679,25 +7156,30 @@ export declare function lessThan(left: Expression, right: Expression): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the less than comparison. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### lessThanOrEqual(left, right) {:#lessthanorequal_b3c3382}
+A new `Expression` representing the less than comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if the first expression is less than or equal to the second expression.
```typescript
-// Check if the 'quantity' field is less than or equal to 20
-lessThan(field("quantity"), field("limit"));
+// Check if the 'age' field is less than 30
+lessThan(field("age"), field("limit"));
```
+### lessThanOrEqual(left, right) {:#lessthanorequal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if the first expression is less than or equal to the second expression.
+
Signature:
```typescript
@@ -7709,25 +7191,30 @@ export declare function lessThanOrEqual(left: Expression, right: Expression): Bo
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the less than or equal to comparison. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### mod(left, right) {:#mod_b3c3382}
+A new `Expression` representing the less than or equal to comparison.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the modulo (remainder) of dividing two expressions.
```typescript
-// Calculate the remainder of dividing 'field1' by 'field2'.
-mod(field("field1"), field("field2"));
+// Check if the 'quantity' field is less than or equal to 20
+lessThan(field("quantity"), field("limit"));
```
+### mod(left, right) {:#mod_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the modulo (remainder) of dividing two expressions.
+
Signature:
```typescript
@@ -7739,25 +7226,30 @@ export declare function mod(left: Expression, right: Expression): FunctionExpres
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The dividend expression. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The divisor expression. A new representing the modulo operation. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The divisor expression. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### notEqual(left, right) {:#notequal_b3c3382}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the modulo operation.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if two expressions are not equal.
```typescript
-// Check if the 'status' field is not equal to field 'finalState'
-notEqual(field("status"), field("finalState"));
+// Calculate the remainder of dividing 'field1' by 'field2'.
+mod(field("field1"), field("field2"));
```
+### notEqual(left, right) {:#notequal_b3c3382}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if two expressions are not equal.
+
Signature:
```typescript
@@ -7769,12 +7261,23 @@ export declare function notEqual(left: Expression, right: Expression): BooleanEx
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The first expression to compare. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. A new Expr representing the inequality comparison. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The second expression to compare. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A new `Expression` representing the inequality comparison.
+
+### Example
+
+
+```typescript
+// Check if the 'status' field is not equal to field 'finalState'
+notEqual(field("status"), field("finalState"));
+
+```
+
### pipelineResultEqual(left, right) {:#pipelineresultequal_707a755}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -7792,8 +7295,8 @@ export declare function pipelineResultEqual(left: PipelineResult, right: Pipelin
| Parameter | Type | Description |
| --- | --- | --- |
-| left | [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) | |
-| right | [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) | |
+| left | [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) | First PipelineResult to compare. |
+| right | [PipelineResult](./firestore_pipelines.pipelineresult.md#pipelineresult_class) | Second PipelineResult to compare. |
Returns:
@@ -7801,16 +7304,10 @@ boolean
### subtract(left, right) {:#subtract_b3c3382}
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
-Creates an expression that subtracts two expressions.
-
-```typescript
-// Subtract the 'discount' field from the 'price' field
-subtract(field("price"), field("discount"));
-
-```
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that subtracts two expressions.
Signature:
@@ -7823,12 +7320,23 @@ export declare function subtract(left: Expression, right: Expression): FunctionE
| Parameter | Type | Description |
| --- | --- | --- |
| left | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract from. |
-| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract. A new representing the subtraction operation. |
+| right | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to subtract. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the subtraction operation.
+
+### Example
+
+
+```typescript
+// Subtract the 'discount' field from the 'price' field
+subtract(field("price"), field("discount"));
+
+```
+
## function(mapExpr, ...)
### mapRemove(mapExpr, key) {:#mapremove_23c7d51}
@@ -7838,12 +7346,6 @@ export declare function subtract(left: Expression, right: Expression): FunctionE
Creates an expression that removes a key from the map produced by evaluating an expression.
-```
-// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), 'baz');
-
-```
-
Signature:
```typescript
@@ -7861,19 +7363,23 @@ export declare function mapRemove(mapExpr: Expression, key: string): FunctionExp
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### mapRemove(mapExpr, keyExpr) {:#mapremove_9fbcaa3}
-
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that removes a key from the map produced by evaluating an expression.
```
// Removes the key 'baz' from the input map.
-mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
+mapRemove(map({foo: 'bar', baz: true}), 'baz');
+@example
```
+### mapRemove(mapExpr, keyExpr) {:#mapremove_9fbcaa3}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that removes a key from the map produced by evaluating an expression.
+
Signature:
```typescript
@@ -7891,6 +7397,16 @@ export declare function mapRemove(mapExpr: Expression, keyExpr: Expression): Fun
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+### Example
+
+
+```
+// Removes the key 'baz' from the input map.
+mapRemove(map({foo: 'bar', baz: true}), constant('baz'));
+@example
+
+```
+
## function(mapExpression, ...)
### mapGet(mapExpression, subField) {:#mapget_688c050}
@@ -7900,12 +7416,6 @@ export declare function mapRemove(mapExpr: Expression, keyExpr: Expression): Fun
Accesses a value from a map (object) expression using the provided key.
-```typescript
-// Get the 'city' value from the 'address' map field
-mapGet(field("address"), "city");
-
-```
-
Signature:
```typescript
@@ -7917,12 +7427,23 @@ export declare function mapGet(mapExpression: Expression, subField: string): Fun
| Parameter | Type | Description |
| --- | --- | --- |
| mapExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the map. |
-| subField | string | The key to access in the map. A new representing the value associated with the given key in the map. |
+| subField | string | The key to access in the map. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the value associated with the given key in the map.
+
+### Example
+
+
+```typescript
+// Get the 'city' value from the 'address' map field
+mapGet(field("address"), "city");
+
+```
+
## function(mapField, ...)
### mapMerge(mapField, secondMap, otherMaps) {:#mapmerge_70a564b}
@@ -7932,13 +7453,6 @@ export declare function mapGet(mapExpression: Expression, subField: string): Fun
Creates an expression that merges multiple map values.
-```
-// Merges the map in the settings field with, a map literal, and a map in
-// that is conditionally returned by another expression
-mapMerge('settings', { enabled: true }, conditional(field('isAdmin'), { admin: true}, {})
-
-```
-
Signature:
```typescript
@@ -7957,6 +7471,16 @@ export declare function mapMerge(mapField: string, secondMap: Record
-
-
Signature:
@@ -8089,12 +7613,26 @@ export declare function execute(options: PipelineExecuteOptions): Promise
+
+Signature:
+
+```typescript
+export declare function execute(pipeline: Pipeline): Promise
+### Example
-Constant instance. |
+| value | number | The number value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_6dac335}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9037,12 +8711,14 @@ export declare function constant(value: VectorValue): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The VectorValue value. A new Constant instance. |
+| value | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The VectorValue value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_7c807cd}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9060,12 +8736,14 @@ export declare function constant(value: string): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | string | The string value. A new Constant instance. |
+| value | string | The string value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_b2e4f8d}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9083,12 +8761,14 @@ export declare function constant(value: boolean): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | boolean | The boolean value. A new Constant instance. |
+| value | boolean | The boolean value. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_73ebd84}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9106,12 +8786,14 @@ export declare function constant(value: null): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | null | The null value. A new Constant instance. |
+| value | null | The null value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_72a76cb}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9129,12 +8811,14 @@ export declare function constant(value: GeoPoint): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [GeoPoint](./firestore_.geopoint.md#geopoint_class) | The GeoPoint value. A new Constant instance. |
+| value | [GeoPoint](./firestore_.geopoint.md#geopoint_class) | The GeoPoint value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_000477d}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9152,12 +8836,14 @@ export declare function constant(value: Timestamp): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Timestamp](./firestore_.timestamp.md#timestamp_class) | The Timestamp value. A new Constant instance. |
+| value | [Timestamp](./firestore_.timestamp.md#timestamp_class) | The Timestamp value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_5131bf7}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9175,12 +8861,14 @@ export declare function constant(value: Date): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | Date | The Date value. A new Constant instance. |
+| value | Date | The Date value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_fdf565d}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9198,12 +8886,14 @@ export declare function constant(value: Bytes): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Bytes](./firestore_.bytes.md#bytes_class) | The Bytes value. A new Constant instance. |
+| value | [Bytes](./firestore_.bytes.md#bytes_class) | The Bytes value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### constant(value) {:#constant_bcd2b0b}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9221,12 +8911,14 @@ export declare function constant(value: DocumentReference): Expression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [DocumentReference](./firestore_.documentreference.md#documentreference_class) | The DocumentReference value. A new Constant instance. |
+| value | [DocumentReference](./firestore_.documentreference.md#documentreference_class) | The DocumentReference value. |
Returns:
[Expression](./firestore_pipelines.expression.md#expression_class)
+A new `Constant` instance.
+
### exists(value) {:#exists_f3daf14}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -9234,12 +8926,6 @@ export declare function constant(value: DocumentReference): Expression;
Creates an expression that checks if a field exists.
-```typescript
-// Check if the document has a field named "phoneNumber"
-exists(field("phoneNumber"));
-
-```
-
Signature:
```typescript
@@ -9250,25 +8936,30 @@ export declare function exists(value: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluates to the name of the field to check. A new representing the 'exists' check. |
+| value | [Expression](./firestore_pipelines.expression.md#expression_class) | An expression evaluates to the name of the field to check. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### isAbsent(value) {:#isabsent_f3daf14}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'exists' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that returns `true` if a value is absent. Otherwise, returns `false` even if the value is `null`.
```typescript
-// Check if the field `value` is absent.
-isAbsent(field("value"));
+// Check if the document has a field named "phoneNumber"
+exists(field("phoneNumber"));
```
+### isAbsent(value) {:#isabsent_f3daf14}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that returns `true` if a value is absent. Otherwise, returns `false` even if the value is `null`.
+
Signature:
```typescript
@@ -9279,25 +8970,30 @@ export declare function isAbsent(value: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to check. A new representing the 'isAbsent' check. |
+| value | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to check. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
-### isError(value) {:#iserror_f3daf14}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'isAbsent' check.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that checks if a given expression produces an error.
```typescript
-// Check if the result of a calculation is an error
-isError(field("title").arrayContains(1));
+// Check if the field `value` is absent.
+isAbsent(field("value"));
```
+### isError(value) {:#iserror_f3daf14}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that checks if a given expression produces an error.
+
Signature:
```typescript
@@ -9308,12 +9004,23 @@ export declare function isError(value: Expression): BooleanExpression;
| Parameter | Type | Description |
| --- | --- | --- |
-| value | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to check. A new representing the 'isError' check. |
+| value | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression to check. |
Returns:
[BooleanExpression](./firestore_pipelines.booleanexpression.md#booleanexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the 'isError' check.
+
+### Example
+
+
+```typescript
+// Check if the result of a calculation is an error
+isError(field("title").arrayContains(1));
+
+```
+
## function(vectorExpression, ...)
### cosineDistance(vectorExpression, vector) {:#cosinedistance_3a80317}
@@ -9323,12 +9030,6 @@ export declare function isError(value: Expression): BooleanExpression;
Calculates the Cosine distance between a vector expression and a vector literal.
-```typescript
-// Calculate the cosine distance between the 'location' field and a target location
-cosineDistance(field("location"), [37.7749, -122.4194]);
-
-```
-
Signature:
```typescript
@@ -9339,26 +9040,31 @@ export declare function cosineDistance(vectorExpression: Expression, vector: num
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. A new representing the cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### cosineDistance(vectorExpression, otherVectorExpression) {:#cosinedistance_17b5bcc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Cosine distance between two vector expressions.
```typescript
-// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
-cosineDistance(field("userVector"), field("itemVector"));
+// Calculate the cosine distance between the 'location' field and a target location
+cosineDistance(field("location"), [37.7749, -122.4194]);
```
+### cosineDistance(vectorExpression, otherVectorExpression) {:#cosinedistance_17b5bcc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Cosine distance between two vector expressions.
+
Signature:
```typescript
@@ -9369,26 +9075,31 @@ export declare function cosineDistance(vectorExpression: Expression, otherVector
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| otherVectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the cosine distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| otherVectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(vectorExpression, vector) {:#dotproduct_3a80317}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the cosine distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between a vector expression and a double array.
```typescript
-// Calculate the dot product between a feature vector and a target vector
-dotProduct(field("features"), [0.5, 0.8, 0.2]);
+// Calculate the cosine distance between the 'userVector' field and the 'itemVector' field
+cosineDistance(field("userVector"), field("itemVector"));
```
+### dotProduct(vectorExpression, vector) {:#dotproduct_3a80317}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between a vector expression and a double array.
+
Signature:
```typescript
@@ -9399,26 +9110,31 @@ export declare function dotProduct(vectorExpression: Expression, vector: number[
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to calculate with. |
-| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. A new representing the dot product between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to calculate with. |
+| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to calculate with. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### dotProduct(vectorExpression, otherVectorExpression) {:#dotproduct_17b5bcc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the dot product between two vector expressions.
```typescript
-// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2'
-dotProduct(field("docVector1"), field("docVector2"));
+// Calculate the dot product between a feature vector and a target vector
+dotProduct(field("features"), [0.5, 0.8, 0.2]);
```
+### dotProduct(vectorExpression, otherVectorExpression) {:#dotproduct_17b5bcc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the dot product between two vector expressions.
+
Signature:
```typescript
@@ -9429,27 +9145,31 @@ export declare function dotProduct(vectorExpression: Expression, otherVectorExpr
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to calculate with. |
-| otherVectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to calculate with. A new representing the dot product between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to calculate with. |
+| otherVectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to calculate with. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### euclideanDistance(vectorExpression, vector) {:#euclideandistance_3a80317}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the dot product between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between a vector expression and a double array.
```typescript
-// Calculate the Euclidean distance between the 'location' field and a target location
-
-euclideanDistance(field("location"), [37.7749, -122.4194]);
+// Calculate the dot product between two document vectors: 'docVector1' and 'docVector2'
+dotProduct(field("docVector1"), field("docVector2"));
```
+### euclideanDistance(vectorExpression, vector) {:#euclideandistance_3a80317}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between a vector expression and a double array.
+
Signature:
```typescript
@@ -9460,26 +9180,32 @@ export declare function euclideanDistance(vectorExpression: Expression, vector:
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. A new representing the Euclidean distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| vector | number\[\] \| [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | The other vector (as an array of doubles or VectorValue) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### euclideanDistance(vectorExpression, otherVectorExpression) {:#euclideandistance_17b5bcc}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Calculates the Euclidean distance between two vector expressions.
```typescript
-// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
-euclideanDistance(field("pointA"), field("pointB"));
+// Calculate the Euclidean distance between the 'location' field and a target location
+
+euclideanDistance(field("location"), [37.7749, -122.4194]);
```
+### euclideanDistance(vectorExpression, otherVectorExpression) {:#euclideandistance_17b5bcc}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Calculates the Euclidean distance between two vector expressions.
+
Signature:
```typescript
@@ -9490,26 +9216,31 @@ export declare function euclideanDistance(vectorExpression: Expression, otherVec
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expr) to compare against. |
-| otherVectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expr) to compare against. A new representing the Euclidean distance between the two vectors. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The first vector (represented as an Expression) to compare against. |
+| otherVectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The other vector (represented as an Expression) to compare against. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
-### vectorLength(vectorExpression) {:#vectorlength_58a039b}
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the Euclidean distance between the two vectors.
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
+### Example
-Creates an expression that calculates the length of a Firestore Vector.
```typescript
-// Get the vector length (dimension) of the field 'embedding'.
-vectorLength(field("embedding"));
+// Calculate the Euclidean distance between two vector fields: 'pointA' and 'pointB'
+euclideanDistance(field("pointA"), field("pointB"));
```
+### vectorLength(vectorExpression) {:#vectorlength_58a039b}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Creates an expression that calculates the length of a Firestore Vector.
+
Signature:
```typescript
@@ -9520,18 +9251,29 @@ export declare function vectorLength(vectorExpression: Expression): FunctionExpr
| Parameter | Type | Description |
| --- | --- | --- |
-| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the Firestore Vector. A new representing the length of the array. |
+| vectorExpression | [Expression](./firestore_pipelines.expression.md#expression_class) | The expression representing the Firestore Vector. |
Returns:
[FunctionExpression](./firestore_pipelines.functionexpression.md#functionexpression_class)
+A new [Expression](./firestore_pipelines.expression.md#expression_class) representing the length of the array.
+
+### Example
+
+
+```typescript
+// Get the vector length (dimension) of the field 'embedding'.
+vectorLength(field("embedding"));
+
+```
+
## AddFieldsStageOptions
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how an AddFieldsStage is evaluated. See .
+Options defining how an AddFieldsStage is evaluated. See [Pipeline.addFields()](./firestore_pipelines.pipeline.md#pipelineaddfields).
Signature:
@@ -9546,7 +9288,7 @@ export declare type AddFieldsStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how an AggregateStage is evaluated. See .
+Options defining how an AggregateStage is evaluated. See [Pipeline.aggregate()](./firestore_pipelines.pipeline.md#pipelineaggregate).
Signature:
@@ -9562,7 +9304,9 @@ export declare type AggregateStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Defines the configuration options for a within a pipeline. This type extends and provides specific settings for how a collection group is identified and processed during pipeline execution.
+Defines the configuration options for a CollectionGroupStage within a pipeline. This type extends [StageOptions](./firestore_pipelines.stageoptions.md#stageoptions_interface) and provides specific settings for how a collection group is identified and processed during pipeline execution.
+
+See [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup) to create a collection group stage.
Signature:
@@ -9578,7 +9322,7 @@ export declare type CollectionGroupStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a CollectionStage is evaluated. See .
+Options defining how a CollectionStage is evaluated. See [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection).
Signature:
@@ -9594,7 +9338,7 @@ export declare type CollectionStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a DatabaseStage is evaluated. See .
+Options defining how a DatabaseStage is evaluated. See [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase).
Signature:
@@ -9607,7 +9351,7 @@ export declare type DatabaseStageOptions = StageOptions & {};
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a DistinctStage is evaluated. See .
+Options defining how a DistinctStage is evaluated. See [Pipeline.distinct()](./firestore_pipelines.pipeline.md#pipelinedistinct).
Signature:
@@ -9622,7 +9366,7 @@ export declare type DistinctStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a DocumentsStage is evaluated. See .
+Options defining how a DocumentsStage is evaluated. See [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments).
Signature:
@@ -9650,7 +9394,7 @@ export declare type ExpressionType = 'Field' | 'Constant' | 'Function' | 'Aggreg
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a FindNearestStage is evaluated. See .
+Options defining how a FindNearestStage is evaluated. See [Pipeline.findNearest()](./firestore_pipelines.pipeline.md#pipelinefindnearest).
Signature:
@@ -9669,7 +9413,7 @@ export declare type FindNearestStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how a LimitStage is evaluated. See .
+Options defining how a LimitStage is evaluated. See [Pipeline.limit()](./firestore_pipelines.pipeline.md#pipelinelimit).
Signature:
@@ -9684,7 +9428,7 @@ export declare type LimitStageOptions = StageOptions & {
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Options defining how an OffsetStage is evaluated. See .
+Options defining how an OffsetStage is evaluated. See [Pipeline.offset()](./firestore_pipelines.pipeline.md#pipelineoffset).
Signature:
@@ -9701,8 +9445,6 @@ export declare type OffsetStageOptions = StageOptions & {
Utility type to create an type that only allows one property of the Type param T to be set.
-type XorY = OneOf<{ x: unknown, y: unknown}> let a = { x: "foo" } // OK let b = { y: "foo" } // OK let c = { a: "foo", y: "foo" } // Not OK
-
Signature:
```typescript
@@ -9713,6 +9455,17 @@ export declare type OneOfexample_option:
-```
- execute({
- pipeline: myPipeline,
- rawOptions: {
- // Override `example_option`. This will not
- // merge with the existing `example_option` object.
- "example_option": {
- foo: "bar"
- }
- }
- }
-
-```
-rawOptions supports dot notation, if you want to override a nested option.
-```
- execute({
- pipeline: myPipeline,
- rawOptions: {
- // Override `example_option.foo` and do not override
- // any other properties of `example_option`.
- "example_option.foo": "bar"
- }
- }
-
-```
- |
+| [rawOptions](./firestore_pipelines.pipelineexecuteoptions.md#pipelineexecuteoptionsrawoptions) | { \[name: string\]: unknown; } | (Public Preview) An escape hatch to set options not known at SDK build time. These values will be passed directly to the Firestore backend and not used by the SDK.The option name will be used as provided. And must match the name format used by the backend (hint: use a snake\_case\_name).Custom option values can be any type supported by Firestore (for example: string, boolean, number, map, …). Value types not known to the SDK will be rejected.Values specified in rawOptions will take precedence over any options with the same name set by the SDK. |
## PipelineExecuteOptions.indexMode
@@ -94,6 +68,16 @@ Custom option values can be any type supported by Firestore (for example: string
Values specified in rawOptions will take precedence over any options with the same name set by the SDK.
+Signature:
+
+```typescript
+rawOptions?: {
+ [name: string]: unknown;
+ };
+```
+
+### Example 1
+
Override the `example_option`:
```
@@ -109,6 +93,9 @@ Override the `example_option`:
}
```
+
+### Example 2
+
`rawOptions` supports dot notation, if you want to override a nested option.
```
@@ -123,10 +110,3 @@ Override the `example_option`:
```
-Signature:
-
-```typescript
-rawOptions?: {
- [name: string]: unknown;
- };
-```
diff --git a/docs-devsite/firestore_pipelines.pipelineresult.md b/docs-devsite/firestore_pipelines.pipelineresult.md
index b5dfb1a41d..6a04334e14 100644
--- a/docs-devsite/firestore_pipelines.pipelineresult.md
+++ b/docs-devsite/firestore_pipelines.pipelineresult.md
@@ -13,7 +13,7 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the or methods.
+A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the [PipelineResult.data()](./firestore_pipelines.pipelineresult.md#pipelineresultdata) or [PipelineResult.get()](./firestore_pipelines.pipelineresult.md#pipelineresultget) methods.
undefined. {string} |
+| [createTime](./firestore_pipelines.pipelineresult.md#pipelineresultcreatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (Public Preview) The time the document was created. Undefined if this result is not a document. |
+| [id](./firestore_pipelines.pipelineresult.md#pipelineresultid) | | string \| undefined | (Public Preview) The ID of the document for which this PipelineResult contains data, if it is a document; otherwise undefined. |
| [ref](./firestore_pipelines.pipelineresult.md#pipelineresultref) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class) \| undefined | (Public Preview) The reference of the document, if it is a document; otherwise undefined. |
-| [updateTime](./firestore_pipelines.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (Public Preview) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. {Timestamp\|undefined} |
+| [updateTime](./firestore_pipelines.pipelineresult.md#pipelineresultupdatetime) | | [Timestamp](./firestore_.timestamp.md#timestamp_class) \| undefined | (Public Preview) The time the document was last updated (at the time the snapshot was generated). Undefined if this result is not a document. |
## Methods
@@ -46,8 +46,6 @@ export declare class PipelineResultPipelineSnapshot. |
## PipelineSnapshot.(constructor)
@@ -64,8 +64,6 @@ constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Times
The time at which the pipeline producing this result is executed.
- {Timestamp}
-
Signature:
```typescript
diff --git a/docs-devsite/firestore_pipelines.pipelinesource.md b/docs-devsite/firestore_pipelines.pipelinesource.md
index 383f31f7fd..31c5192dfd 100644
--- a/docs-devsite/firestore_pipelines.pipelinesource.md
+++ b/docs-devsite/firestore_pipelines.pipelinesource.md
@@ -13,9 +13,9 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Provides the entry point for defining the data source of a Firestore .
+Provides the entry point for defining the data source of a Firestore [Pipeline](./firestore_pipelines.pipeline.md#pipeline_class).
-Use the methods of this class (e.g., , , , or ) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents.
+Use the methods of this class (e.g., [PipelineSource.collection()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollection), [PipelineSource.collectionGroup()](./firestore_pipelines.pipelinesource.md#pipelinesourcecollectiongroup), [PipelineSource.database()](./firestore_pipelines.pipelinesource.md#pipelinesourcedatabase), or [PipelineSource.documents()](./firestore_pipelines.pipelinesource.md#pipelinesourcedocuments)) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents.
Signature:
@@ -154,7 +154,7 @@ createFrom(query: Query): Pipeline;
#### Exceptions
- Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
+`FirestoreError` Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
## PipelineSource.database()
@@ -220,7 +220,7 @@ PipelineType
#### Exceptions
- Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
+`FirestoreError` Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
## PipelineSource.documents()
@@ -247,5 +247,5 @@ PipelineType
#### Exceptions
- Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
+`FirestoreError` Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.
diff --git a/docs-devsite/firestore_pipelines.vectorvalue.md b/docs-devsite/firestore_pipelines.vectorvalue.md
index 8185645466..2b02bcea9f 100644
--- a/docs-devsite/firestore_pipelines.vectorvalue.md
+++ b/docs-devsite/firestore_pipelines.vectorvalue.md
@@ -12,8 +12,6 @@ https://github.com/firebase/firebase-js-sdk
# VectorValue class
Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2).
- VectorValue
-
Signature:
```typescript
diff --git a/packages/firestore/src/api/aggregate.ts b/packages/firestore/src/api/aggregate.ts
index 453f9e0a84..d747905106 100644
--- a/packages/firestore/src/api/aggregate.ts
+++ b/packages/firestore/src/api/aggregate.ts
@@ -55,7 +55,7 @@ export {
* used. Every invocation of this function necessarily involves a round trip to
* the server.
*
- * @param query The query whose result set size is calculated.
+ * @param query - The query whose result set size is calculated.
* @returns A Promise that will be resolved with the count; the count can be
* retrieved from `snapshot.data().count`, where `snapshot` is the
* `AggregateQuerySnapshot` to which the returned Promise resolves.
@@ -95,8 +95,8 @@ export function getCountFromServer<
* used. Every invocation of this function necessarily involves a round trip to
* the server.
*
- * @param query The query whose result set is aggregated over.
- * @param aggregateSpec An `AggregateSpec` object that specifies the aggregates
+ * @param query - The query whose result set is aggregated over.
+ * @param aggregateSpec - An `AggregateSpec` object that specifies the aggregates
* to perform over the result set. The AggregateSpec specifies aliases for each
* aggregate, which can be used to retrieve the aggregate result.
* @example
@@ -147,7 +147,7 @@ export function getAggregateFromServer<
* Converts the core aggregation result to an `AggregateQuerySnapshot`
* that can be returned to the consumer.
* @param query
- * @param aggregateResult Core aggregation result
+ * @param aggregateResult - Core aggregation result
* @internal
*/
function convertToAggregateQuerySnapshot<
diff --git a/packages/firestore/src/api/cache_config.ts b/packages/firestore/src/api/cache_config.ts
index 072c67ec7a..205888d36a 100644
--- a/packages/firestore/src/api/cache_config.ts
+++ b/packages/firestore/src/api/cache_config.ts
@@ -419,7 +419,7 @@ export type PersistentSingleTabManagerSettings = {
/**
* Creates an instance of `PersistentSingleTabManager`.
*
- * @param settings Configures the created tab manager.
+ * @param settings - Configures the created tab manager.
*/
export function persistentSingleTabManager(
settings: PersistentSingleTabManagerSettings | undefined
diff --git a/packages/firestore/src/api/persistent_cache_index_manager.ts b/packages/firestore/src/api/persistent_cache_index_manager.ts
index 6568ebde1d..edd86aad32 100644
--- a/packages/firestore/src/api/persistent_cache_index_manager.ts
+++ b/packages/firestore/src/api/persistent_cache_index_manager.ts
@@ -42,7 +42,7 @@ export class PersistentCacheIndexManager {
* Returns the PersistentCache Index Manager used by the given `Firestore`
* object.
*
- * @return The `PersistentCacheIndexManager` instance, or `null` if local
+ * @returns The `PersistentCacheIndexManager` instance, or `null` if local
* persistent storage is not in use.
*/
export function getPersistentCacheIndexManager(
diff --git a/packages/firestore/src/api/pipeline_impl.ts b/packages/firestore/src/api/pipeline_impl.ts
index e5d650847d..ba4544f407 100644
--- a/packages/firestore/src/api/pipeline_impl.ts
+++ b/packages/firestore/src/api/pipeline_impl.ts
@@ -40,7 +40,7 @@ import { ExpUserDataWriter } from './user_data_writer';
declare module './database' {
/**
* @beta
- * Creates and returns a new PipelineSource, which allows specifying the source stage of a {@link Pipeline}.
+ * Creates and returns a new PipelineSource, which allows specifying the source stage of a {@link @firebase/firestore/pipelines#Pipeline}.
*
* @example
* ```
@@ -59,23 +59,22 @@ declare module './database' {
* The returned Promise can be used to track the progress of the pipeline execution
* and retrieve the results (or handle any errors) asynchronously.
*
- * The pipeline results are returned as a {@link PipelineSnapshot} that contains
- * a list of {@link PipelineResult} objects. Each {@link PipelineResult} typically
+ * The pipeline results are returned as a {@link @firebase/firestore/pipelines#PipelineSnapshot} that contains
+ * a list of {@link @firebase/firestore/pipelines#PipelineResult} objects. Each {@link @firebase/firestore/pipelines#PipelineResult} typically
* represents a single key/value map that has passed through all the
* stages of the pipeline, however this might differ depending on the stages involved in the
* pipeline. For example:
*
*
- *
*
- *
- *
*
- *
- *
*
*
- *
*
*
- *
*
*
- *
*
*
- *
- *
*
*
- *
*
- * {@link vector}.
- *
- * @class VectorValue
*/
export class VectorValue {
private readonly _values: number[];
@@ -74,7 +72,7 @@ export class VectorValue {
/**
* Builds a `VectorValue` instance from a JSON object created by {@link VectorValue.toJSON}.
*
- * @param json a JSON object represention of a `VectorValue` instance.
+ * @param json - a JSON object represention of a `VectorValue` instance.
* @returns an instance of {@link VectorValue} if the JSON object could be parsed. Throws a
* {@link FirestoreError} if an error occurs.
*/
diff --git a/packages/firestore/src/local/document_overlay_cache.ts b/packages/firestore/src/local/document_overlay_cache.ts
index 8cfb5412d5..471b1b7538 100644
--- a/packages/firestore/src/local/document_overlay_cache.ts
+++ b/packages/firestore/src/local/document_overlay_cache.ts
@@ -96,7 +96,7 @@ export interface DocumentOverlayCache {
* Only overlays that contain a change past `sinceBatchId` are returned.
* @param count - The number of overlays to return. Can be exceeded if the last
* batch contains more entries.
- * @return Mapping of each document key in the collection group to its overlay.
+ * @returns Mapping of each document key in the collection group to its overlay.
*/
getOverlaysForCollectionGroup(
transaction: PersistenceTransaction,
diff --git a/packages/firestore/src/local/index_manager.ts b/packages/firestore/src/local/index_manager.ts
index d81693acc6..e0ab95f19a 100644
--- a/packages/firestore/src/local/index_manager.ts
+++ b/packages/firestore/src/local/index_manager.ts
@@ -120,9 +120,9 @@ export interface IndexManager {
* Returns a list of field indexes that correspond to the specified collection
* group.
*
- * @param collectionGroup The collection group to get matching field indexes
+ * @param collectionGroup - The collection group to get matching field indexes
* for.
- * @return A collection of field indexes for the specified collection group.
+ * @returns A collection of field indexes for the specified collection group.
*/
getFieldIndexes(
transaction: PersistenceTransaction,
diff --git a/packages/firestore/src/local/local_documents_view.ts b/packages/firestore/src/local/local_documents_view.ts
index fa64ed76eb..5010e9b800 100644
--- a/packages/firestore/src/local/local_documents_view.ts
+++ b/packages/firestore/src/local/local_documents_view.ts
@@ -210,7 +210,7 @@ export class LocalDocumentsView {
* @param existenceStateChanged - A set of documents whose existence states
* might have changed. This is used to determine if we need to re-calculate
* overlays from mutation queues.
- * @return A map represents the local documents view.
+ * @returns A map represents the local documents view.
*/
computeViews(
transaction: PersistenceTransaction,
@@ -394,10 +394,10 @@ export class LocalDocumentsView {
* returned together, the total number of documents returned can exceed {@code count}.
*
* @param transaction
- * @param collectionGroup The collection group for the documents.
- * @param offset The offset to index into.
- * @param count The number of documents to return
- * @return A LocalWriteResult with the documents that follow the provided offset and the last processed batch id.
+ * @param collectionGroup - The collection group for the documents.
+ * @param offset - The offset to index into.
+ * @param count - The number of documents to return
+ * @returns A LocalWriteResult with the documents that follow the provided offset and the last processed batch id.
*/
getNextDocuments(
transaction: PersistenceTransaction,
diff --git a/packages/firestore/src/local/shared_client_state.ts b/packages/firestore/src/local/shared_client_state.ts
index 1000e63a0f..5829d5ee8d 100644
--- a/packages/firestore/src/local/shared_client_state.ts
+++ b/packages/firestore/src/local/shared_client_state.ts
@@ -182,7 +182,7 @@ export interface SharedClientState {
* Notifies other clients when remote documents have changed due to loading
* a bundle.
*
- * @param collectionGroups The collection groups affected by this bundle.
+ * @param collectionGroups - The collection groups affected by this bundle.
*/
notifyBundleLoaded(collectionGroups: Set(
diff --git a/packages/firestore/src/util/logic_utils.ts b/packages/firestore/src/util/logic_utils.ts
index b2167c385e..f9fed07786 100644
--- a/packages/firestore/src/util/logic_utils.ts
+++ b/packages/firestore/src/util/logic_utils.ts
@@ -77,8 +77,8 @@ export function computeInExpansion(filter: Filter): Filter {
* with two elements: a composite filter that performs (A && C), and a composite filter that
* performs (B && C).
*
- * @param filter the composite filter to calculate DNF transform for.
- * @return the terms in the DNF transform.
+ * @param filter - the composite filter to calculate DNF transform for.
+ * @returns the terms in the DNF transform.
*/
export function getDnfTerms(filter: CompositeFilter): Filter[] {
if (filter.getFilters().length === 0) {
diff --git a/packages/firestore/src/util/pipeline_util.ts b/packages/firestore/src/util/pipeline_util.ts
index a7400828fd..d191e08e10 100644
--- a/packages/firestore/src/util/pipeline_util.ts
+++ b/packages/firestore/src/util/pipeline_util.ts
@@ -88,7 +88,7 @@ export function aliasedAggregateToMap(
}
/**
- * Converts a value to an Expr, Returning either a Constant, MapFunction,
+ * Converts a value to an Expression, Returning either a Constant, MapFunction,
* ArrayFunction, or the input itself (if it's already an expression).
*
* @private
@@ -112,7 +112,7 @@ export function vectorToExpr(
}
/**
- * Converts a value to an Expr, Returning either a Constant, MapFunction,
+ * Converts a value to an Expression, Returning either a Constant, MapFunction,
* ArrayFunction, or the input itself (if it's already an expression).
* If the input is a string, it is assumed to be a field name, and a
* field(value) is returned.
@@ -130,7 +130,7 @@ export function fieldOrExpression(value: unknown): Expression {
}
}
/**
- * Converts a value to an Expr, Returning either a Constant, MapFunction,
+ * Converts a value to an Expression, Returning either a Constant, MapFunction,
* ArrayFunction, or the input itself (if it's already an expression).
*
* @private
diff --git a/packages/firestore/src/util/testing_hooks.ts b/packages/firestore/src/util/testing_hooks.ts
index 36422172a4..6c9aa955f7 100644
--- a/packages/firestore/src/util/testing_hooks.ts
+++ b/packages/firestore/src/util/testing_hooks.ts
@@ -43,9 +43,9 @@ export class TestingHooks {
* rely on any particular ordering. If a given callback is registered multiple
* times then it will be notified multiple times, once per registration.
*
- * @param callback the callback to invoke upon existence filter mismatch.
+ * @param callback - the callback to invoke upon existence filter mismatch.
*
- * @return a function that, when called, unregisters the given callback; only
+ * @returns a function that, when called, unregisters the given callback; only
* the first invocation of the returned function does anything; all subsequent
* invocations do nothing.
*/
diff --git a/packages/firestore/src/util/testing_hooks_spi.ts b/packages/firestore/src/util/testing_hooks_spi.ts
index e6c729e366..3abcf50e3f 100644
--- a/packages/firestore/src/util/testing_hooks_spi.ts
+++ b/packages/firestore/src/util/testing_hooks_spi.ts
@@ -26,7 +26,7 @@ export let testingHooksSpi: TestingHooksSpi | null = null;
/**
* Sets the value of the `testingHooksSpi` object.
- * @param instance the instance to set.
+ * @param instance - the instance to set.
*/
export function setTestingHooksSpi(instance: TestingHooksSpi): void {
if (testingHooksSpi) {
diff --git a/packages/firestore/src/util/types.ts b/packages/firestore/src/util/types.ts
index ad272991ff..b5dd09fbbc 100644
--- a/packages/firestore/src/util/types.ts
+++ b/packages/firestore/src/util/types.ts
@@ -79,10 +79,13 @@ export interface DocumentLike {
* Utility type to create an type that only allows one
* property of the Type param T to be set.
*
- * type XorY = OneOf<{ x: unknown, y: unknown}>
+ * @example
+ * ```
+ * type XorY = OneOf<{ x: unknown, y: unknown }>
* let a = { x: "foo" } // OK
* let b = { y: "foo" } // OK
* let c = { a: "foo", y: "foo" } // Not OK
+ * ```
*/
export type OneOf