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.
Namespace
Google.Cloud.FirestoreAssembly
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 | |
---|---|
Name | Description |
segments | 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 |
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 | |
---|---|
Name | Description |
other | FieldPath An object to compare with this instance. |
Returns | |
---|---|
Type | Description |
int | A value that indicates the relative order of the objects being compared. The return value has these meanings: Meaning Less than zero This instance precedes Zero This instance occurs in the same position in the sort order as Greater than zero This instance follows |
GetHashCode()
public override int GetHashCode()
Serves as the default hash function.
Returns | |
---|---|
Type | Description |
int | A hash code for the current object. |
ToString()
public override string ToString()
Returns a string that represents the current object.
Returns | |
---|---|
Type | Description |
string | A string that represents the current object. |