java.lang.Object
com.google.cloud.firestore.pipeline.expressions.Expression
com.google.cloud.firestore.pipeline.expressions.Field
All Implemented Interfaces:
Selectable

@BetaApi public final class Field extends Expression implements Selectable
Represents a reference to a field in a Firestore document.

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 Expression.field(String) method:


 // Create a Field instance for the 'name' field
 Field nameField = Field.of("name");

 // Create a Field instance for a nested field 'address.city'
 Field cityField = Field.of("address.city");
 
  • Field Details

  • Method Details

    • ofUserPath

      @InternalApi public static Field ofUserPath(String path)
      Creates a 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:

      
       // Create a Field instance for the 'title' field
       Field titleField = Field.of("title");
      
       // Create a Field instance for a nested field 'author.firstName'
       Field authorFirstNameField = Field.of("author.firstName");
       
      Parameters:
      path - The path to the field.
      Returns:
      A new Field instance representing the specified field.
    • ofServerPath

      @InternalApi public static Field ofServerPath(String path)
    • toProto

      @InternalApi public Value toProto()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPath

      @InternalApi public FieldPath getPath()