A FieldPath refers to a field in a document. The path may consist of asingle field name (referring to a top-level field in the document), or alist of field names (referring to a nested field in the document).

Create a FieldPath by providing field names. If more than one fieldname is provided, the path will point to a nested field in a document.

Index

Constructors

Methods

Constructors

constructor

  • newFieldPath(...fieldNamesstring[]):FieldPath
  • Creates a FieldPath from the provided field names. If more than one fieldname is provided, the path will point to a nested field in a document.

    Parameters

    • Rest...fieldNames:string[]

      A list of field names.

    ReturnsFieldPath

Methods

isEqual

  • isEqual(otherFieldPath):boolean
  • Returns true if thisFieldPath is equal to the provided one.

    Parameters

    • other:FieldPath

      TheFieldPath to compare against.

    Returnsboolean

    true if thisFieldPath is equal to the provided one.

Static documentId

  • documentId():FieldPath
  • Returns a special sentinelFieldPath to refer to the ID of a document.It can be used in queries to sort or filter by the document ID.

    ReturnsFieldPath

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 2022-07-27 UTC.