Field class

This API is 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 aPipeline 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 aField instance using the static method:

Signature:

exportdeclareclassFieldextendsExpressionimplementsSelectable

Extends:Expression

Implements:Selectable

Properties

PropertyModifiersTypeDescription
aliasstring(Public Preview)
exprExpression(Public Preview)
expressionTypeExpressionType(Public Preview)
fieldNamestring(Public Preview)
selectabletrue(Public Preview)

Field.alias

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

getalias():string;

Field.expr

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

getexpr():Expression;

Field.expressionType

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

readonlyexpressionType:ExpressionType;

Field.fieldName

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

getfieldName():string;

Field.selectable

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

selectable:true;

Example

// Create a Field instance for the 'name' fieldconstnameField=field("name");// Create a Field instance for a nested field 'address.city'constcityField=field("address.city");

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-15 UTC.