FieldPath

public final classFieldPath


AFieldPath 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).

Summary

Public methods

static @NonNullFieldPath

Returns A special sentinelFieldPath to refer to the ID of a document.

boolean
int
static @NonNullFieldPath
of(String[] fieldNames)

Creates aFieldPath from the provided field names.

String

Public methods

documentId

public static @NonNullFieldPath documentId()

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.

equals

public boolean equals(Object o)

hashCode

public int hashCode()

of

public static @NonNullFieldPath of(String[] fieldNames)

Creates aFieldPath from the provided field names. If more than one field name is provided, the path will point to a nested field in a document.

Parameters
String[] fieldNames

A list of field names.

Returns
@NonNullFieldPath

AFieldPath that points to a field location in a document.

toString

public String toString()

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 2025-07-21 UTC.