Firestore API - Class FieldPath (3.5.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 > FieldPath

Namespace

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. 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
NameDescription
segmentsstring

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
TypeDescription
FieldPath

Methods

CompareTo(FieldPath)

public int CompareTo(FieldPath other)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameter
NameDescription
otherFieldPath

An object to compare with this instance.

Returns
TypeDescription
int

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value

Meaning

Less than zero

This instance precedes other in the sort order.

Zero

This instance occurs in the same position in the sort order as other.

Greater than zero

This instance follows other in the sort order.

GetHashCode()

public override int GetHashCode()

Serves as the default hash function.

Returns
TypeDescription
int

A hash code for the current object.

Overrides

ToString()

public override string ToString()

Returns a string that represents the current object.

Returns
TypeDescription
string

A string that represents the current object.

Overrides