# Class FieldPath (2.27.0)

2.27.0 (latest) 2.26.0 2.23.0 2.22.0 2.21.0 2.20.2 2.19.0 2.18.0 2.17.2 2.16.1 2.15.0 2.14.0 2.13.1 2.12.0 2.11.1 2.10.1 2.9.1 2.8.0 2.7.3 2.6.1 2.5.3 2.4.0 2.3.4 2.2.0 2.1.3 2.0.2 1.9.2 1.8.1 1.7.0 1.6.2 1.5.0 1.4.0 1.3.0

    FieldPath(*parts: str)

Field Path object for client use.

A field path is a sequence of element keys, separated by periods.
Each element key can be either a simple identifier, or a full unicode
string.

In the string representation of a field path, non-identifier elements
must be quoted using backticks, with internal backticks and backslashes
escaped with a backslash.

## Methods

### __add__

    __add__(other)

Adds `other` field path to end of this field path.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `FieldPath, str` The field path to add to the end of this `FieldPath`. |

### document_id

    document_id() -> str

A special FieldPath value to refer to the ID of a document. It can be used
in queries to sort or filter by the document ID.

Returns: A special sentinel value to refer to the ID of a document.

### eq_or_parent

    eq_or_parent(other) -> bool

Check whether `other` is an ancestor.

### from_api_repr

    from_api_repr(api_repr: str) -> google.cloud.firestore_v1.field_path.FieldPath

Factory: create a FieldPath from the string formatted per the API.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `api_repr` | `str` a string path, with non-identifier elements quoted |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `ValueErro` | if the parsing fails: |

### from_string

    from_string(path_string: str) -> google.cloud.firestore_v1.field_path.FieldPath

Factory: create a FieldPath from a unicode string representation.

This method splits on the character `.` and disallows the
characters ``` ``*/[] ```. To create a FieldPath whose components have
those characters, call the constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `path_string` | `str` A unicode string which cannot contain |

### lineage

    lineage() -> set["FieldPath"]

Return field paths for all parents.

Returns: Set\[`FieldPath`\]

### to_api_repr

    to_api_repr() -> str

Render a quoted string representation of the FieldPath