4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.1

    public sealed class FieldPath : IEquatable<FieldPath>, IComparable<FieldPath>

Reference documentation and code samples for the Firestore API class FieldPath.

An immutable path of field names, used to identify parts of a document.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> FieldPath

## Implements

[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[FieldPath](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath), [IComparable](https://learn.microsoft.com/dotnet/api/system.icomparable-1)[FieldPath](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath)

## Inherited Members

[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)

## Namespace

[Google.Cloud.Firestore](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)

## Assembly

Google.Cloud.Firestore.dll

## Remarks

Ordering between field paths is primarily to provide canonical orderings for sets of
paths, for example in a [FieldMask](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldMask). This ordering is performed segment-wise,
using ordinal string comparisons.

## Constructors

### FieldPath(params string\[\])

    public FieldPath(params string[] segments)

Creates a path from multiple segments. Each segment is treated verbatim: it may contain dots, which will lead to the segment being escaped in the
path's string representation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `segments` | `https://learn.microsoft.com/dotnet/api/system.string` The segments of the path. This must not be null or empty, and it must not contain any null or empty elements. |

## Properties

### DocumentId

    public static FieldPath DocumentId { get; }

Sentinel field path to refer to the ID of a document. Used in queries to sort or filter
by the document ID.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath` |   |

## Methods

### CompareTo(FieldPath)

    public int CompareTo(FieldPath other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### ToString()

    public override string ToString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)