You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates an expression that returns the data type of this expression's result, as a string.
4465
4502
4503
+
This is evaluated on the backend. This means: 1. Generic typed elements (like `array<string>`<!-- -->) evaluate strictly to the primitive `'array'`<!-- -->. 2. Any custom `FirestoreDataConverter` mappings are ignored. 3. For numeric values, the backend does not yield the JavaScript `"number"` type; it evaluates precisely as `"int64"` or `"float64"`<!-- -->. 4. For date or timestamp objects, the backend evaluates to `"timestamp"`<!-- -->.
|[first(expression)](./firestore_lite_pipelines.md#first_1138a27)| <b><i>(Public Preview)</i></b> Creates an aggregation that finds the first value of an expression across multiple stage inputs. |
88
88
|[greaterThan(expression, value)](./firestore_lite_pipelines.md#greaterthan_01df3cf)| <b><i>(Public Preview)</i></b> Creates an expression that checks if an expression is greater than a constant value. |
89
89
|[greaterThanOrEqual(expression, value)](./firestore_lite_pipelines.md#greaterthanorequal_01df3cf)| <b><i>(Public Preview)</i></b> Creates an expression that checks if an expression is greater than or equal to a constant value. |
90
+
|[isType(expression, type)](./firestore_lite_pipelines.md#istype_27398ce)| <b><i>(Public Preview)</i></b> Creates an expression that checks if the result of an expression is of the given type. |
90
91
|[last(expression)](./firestore_lite_pipelines.md#last_1138a27)| <b><i>(Public Preview)</i></b> Creates an aggregation that finds the last value of an expression across multiple stage inputs. |
91
92
|[length\_2(expression)](./firestore_lite_pipelines.md#length_2_1138a27)| <b><i>(Public Preview)</i></b> Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
92
93
|[lessThan(expression, value)](./firestore_lite_pipelines.md#lessthan_01df3cf)| <b><i>(Public Preview)</i></b> Creates an expression that checks if an expression is less than a constant value. |
|[greaterThan(fieldName, value)](./firestore_lite_pipelines.md#greaterthan_65e2f32)| <b><i>(Public Preview)</i></b> Creates an expression that checks if a field's value is greater than a constant value. |
166
167
|[greaterThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#greaterthanorequal_2e16acb)| <b><i>(Public Preview)</i></b> Creates an expression that checks if a field's value is greater than or equal to an expression. |
167
168
|[greaterThanOrEqual(fieldName, value)](./firestore_lite_pipelines.md#greaterthanorequal_65e2f32)| <b><i>(Public Preview)</i></b> Creates an expression that checks if a field's value is greater than or equal to a constant value. |
169
+
|[isType(fieldName, type)](./firestore_lite_pipelines.md#istype_5da287e)| <b><i>(Public Preview)</i></b> Creates an expression that checks if the value in the specified field is of the given type. |
168
170
|[last(fieldName)](./firestore_lite_pipelines.md#last_e5b0480)| <b><i>(Public Preview)</i></b> Creates an aggregation that finds the last value of a field across multiple stage inputs. |
169
171
|[length\_2(fieldName)](./firestore_lite_pipelines.md#length_2_e5b0480)| <b><i>(Public Preview)</i></b> Creates an expression that calculates the length of a string, array, map, vector, or bytes. |
170
172
|[lessThan(fieldName, expression)](./firestore_lite_pipelines.md#lessthan_1e91657)| <b><i>(Public Preview)</i></b> Creates an expression that checks if a field's value is less than an expression. |
|[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 <code>SetOptions</code> with <code>merge: true</code>. |
406
408
|[SortStageOptions](./firestore_lite_pipelines.md#sortstageoptions)| <b><i>(Public Preview)</i></b> Options defining how a SortStage is evaluated. See [Pipeline.sort()](./firestore_pipelines.pipeline.md#pipelinesort)<!---->. |
407
409
|[TimeGranularity](./firestore_lite_pipelines.md#timegranularity)| <b><i>(Public Preview)</i></b> Specify time granularity for expressions. |
410
+
|[Type](./firestore_lite_pipelines.md#type)| <b><i>(Public Preview)</i></b> An enumeration of the different types generated by the Firestore backend.<ul> <li>Numerics evaluate directly to backend representation (<code>int64</code> or <code>float64</code>), not JS <code>number</code>.</li> <li>JavaScript <code>Date</code> and firestore <code>Timestamp</code> objects strictly evaluate to <code>'timestamp'</code>.</li> <li>Advanced configurations parsing backend types (such as <code>decimal128</code>, <code>max_key</code> or <code>min_key</code> from BSON) are also incorporated in this union string type. Note that <code>decimal128</code> is a backend-only numeric type that the JavaScript SDK cannot create natively, but can be evaluated in pipelines.</li> </ul> |
408
411
|[UnionStageOptions](./firestore_lite_pipelines.md#unionstageoptions)| <b><i>(Public Preview)</i></b> Options defining how a UnionStage is evaluated. See [Pipeline.union()](./firestore_pipelines.pipeline.md#pipelineunion)<!---->. |
409
412
|[UnnestStageOptions](./firestore_lite_pipelines.md#unneststageoptions)| <b><i>(Public Preview)</i></b> Represents the specific options available for configuring an <code>UnnestStage</code> within a pipeline. |
410
413
|[WhereStageOptions](./firestore_lite_pipelines.md#wherestageoptions)| <b><i>(Public Preview)</i></b> Options defining how a WhereStage is evaluated. See [Pipeline.where()](./firestore_pipelines.pipeline.md#pipelinewhere)<!---->. |
A new `BooleanExpression` that evaluates to true if the field's value is of the given type, false otherwise.
5084
+
5085
+
### Example
5086
+
5087
+
5088
+
```typescript
5089
+
// Check if the 'price' field is a floating point number (evaluating to true inside pipeline conditionals)
5090
+
isType('price', 'float64');
5091
+
5092
+
```
5093
+
5017
5094
### last(fieldName) {:#last_e5b0480}
5018
5095
5019
5096
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
@@ -7242,6 +7319,8 @@ trunc("rating", 2);
7242
7319
7243
7320
Creates an expression that returns the data type of the data in the specified field.
7244
7321
7322
+
String inputs passed iteratively to this global function act as `field()` path lookups. If you wish to pass a string literal value, it must be wrapped: `type(constant("my_string"))`<!-- -->.
7323
+
7245
7324
<b>Signature:</b>
7246
7325
7247
7326
```typescript
@@ -10728,6 +10807,21 @@ Specify time granularity for expressions.
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
10813
+
>
10814
+
10815
+
An enumeration of the different types generated by the Firestore backend.
10816
+
10817
+
<ul> <li>Numerics evaluate directly to backend representation (`int64` or `float64`<!-- -->), not JS `number`<!-- -->.</li> <li>JavaScript `Date` and firestore `Timestamp` objects strictly evaluate to `'timestamp'`<!-- -->.</li> <li>Advanced configurations parsing backend types (such as `decimal128`<!-- -->, `max_key` or `min_key` from BSON) are also incorporated in this union string type. Note that `decimal128` is a backend-only numeric type that the JavaScript SDK cannot create natively, but can be evaluated in pipelines.</li> </ul>
Creates an expression that returns the data type of this expression's result, as a string.
4465
4502
4503
+
This is evaluated on the backend. This means: 1. Generic typed elements (like `array<string>`<!-- -->) evaluate strictly to the primitive `'array'`<!-- -->. 2. Any custom `FirestoreDataConverter` mappings are ignored. 3. For numeric values, the backend does not yield the JavaScript `"number"` type; it evaluates precisely as `"int64"` or `"float64"`<!-- -->. 4. For date or timestamp objects, the backend evaluates to `"timestamp"`<!-- -->.
0 commit comments