A dot-separated path for navigating sub-objects (e.g. nested maps) within a document.
Package
@google-cloud/firestore!Constructors
(constructor)(segments)
constructor
(...
segments
:
string
[]);
Constructs a Firestore Field Path.
Name | Description |
segments | string[]
Sequence of field names that form this path. |
Properties
formattedName
/** @override */
get
formattedName
()
:
string
;
String representation of a FieldPath as expected by the API.
Type | Description |
---|---|
string |
Methods
construct(segments)
/** @override */
construct
(
segments
:
string
[])
:
FieldPath
;
Constructs a new instance of FieldPath. We need this instead of using the normal constructor because polymorphic 'this' doesn't work on static methods.
Name | Description |
segments | string[]
Sequence of field names. |
Type | Description |
FieldPath | The newly created FieldPath. |
documentId()
static
documentId
()
:
FieldPath
;
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.
Type | Description |
---|---|
FieldPath | {FieldPath} |
fromArgument(fieldPath)
static
fromArgument
(
fieldPath
:
string
|
firestore
.
FieldPath
)
:
FieldPath
;
Turns a field path argument into a [FieldPath] FieldPath . Supports FieldPaths as input (which are passed through) and dot-separated strings.
Name | Description |
fieldPath | string | FirebaseFirestore.FieldPath
The FieldPath to create. |
Type | Description |
FieldPath | {FieldPath} A field path representation. |
isEqual(other)
isEqual
(
other
:
FieldPath
)
:
boolean
;
Returns true if this FieldPath
is equal to the provided value.
Name | Description |
other | FieldPath
The value to compare against. {boolean} true if this |
Type | Description |
---|---|
boolean |
split(fieldPath)
/** @override */
split
(
fieldPath
:
string
)
:
string
[];
Splits a string into path segments, using dots as separators.
Name | Description |
---|---|
fieldPath | string
The path to split. |
Type | Description |
---|---|
string[] | {Array. |
toString()
toString
()
:
string
;
Returns a string representation of this path.
Type | Description |
string | A string representing this path. |