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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eFieldPath\u003c/code\u003e class in the Firestore API is 3.10.0, with prior versions ranging down to 2.3.1 also available for reference.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFieldPath\u003c/code\u003e class is an immutable structure used to represent a path of field names within a Firestore document, enabling identification of specific document parts.\u003c/p\u003e\n"],["\u003cp\u003eIt implements the \u003ccode\u003eIEquatable\u003c/code\u003e and \u003ccode\u003eIComparable\u003c/code\u003e interfaces for \u003ccode\u003eFieldPath\u003c/code\u003e and provides functionality for comparing, creating, and obtaining a string representation of field paths.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eDocumentId\u003c/code\u003e property within \u003ccode\u003eFieldPath\u003c/code\u003e serves as a sentinel to refer to a document's ID, which can be used for sorting and filtering.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFieldPath\u003c/code\u003e ordering is segment-wise using ordinal string comparisons to provide canonical ordering for sets of paths, such as in a \u003ccode\u003eFieldMask\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Firestore API - Class FieldPath (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.9.0/Google.Cloud.Firestore.FieldPath)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.8.0/Google.Cloud.Firestore.FieldPath)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.7.0/Google.Cloud.Firestore.FieldPath)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.6.0/Google.Cloud.Firestore.FieldPath)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore/3.5.1/Google.Cloud.Firestore.FieldPath)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.4.0/Google.Cloud.Firestore.FieldPath)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.3.0/Google.Cloud.Firestore.FieldPath)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.2.0/Google.Cloud.Firestore.FieldPath)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.1.0/Google.Cloud.Firestore.FieldPath)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.0.0/Google.Cloud.Firestore.FieldPath)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore/2.5.0/Google.Cloud.Firestore.FieldPath)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore/2.4.0/Google.Cloud.Firestore.FieldPath)\n- [2.3.1](/dotnet/docs/reference/Google.Cloud.Firestore/2.3.1/Google.Cloud.Firestore.FieldPath) \n\n public sealed class FieldPath : IEquatable\u003cFieldPath\u003e, IComparable\u003cFieldPath\u003e\n\nReference documentation and code samples for the Firestore API class FieldPath.\n\nAn immutable path of field names, used to identify parts of a document. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e FieldPath \n\nImplements\n----------\n\n[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[FieldPath](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath), [IComparable](https://learn.microsoft.com/dotnet/api/system.icomparable-1)[FieldPath](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldPath) \n\nInherited Members\n-----------------\n\n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)\n\nNamespace\n---------\n\n[Google.Cloud.Firestore](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.dll\n\nRemarks\n-------\n\nOrdering between field paths is primarily to provide canonical orderings for sets of\npaths, for example in a [FieldMask](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FieldMask). This ordering is performed segment-wise,\nusing ordinal string comparisons.\n\nConstructors\n------------\n\n### FieldPath(params string\\[\\])\n\n public FieldPath(params string[] segments)\n\nCreates a path from multiple segments. Each segment is treated verbatim: it may contain dots, which will lead to the segment being escaped in the\npath's string representation.\n\nProperties\n----------\n\n### DocumentId\n\n public static FieldPath DocumentId { get; }\n\nSentinel field path to refer to the ID of a document. Used in queries to sort or filter\nby the document ID.\n\nMethods\n-------\n\n### CompareTo(FieldPath)\n\n public int CompareTo(FieldPath other)\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)"]]