The (mutable) document this path belongs to.
The full document path so far.
Returns a new mutable document path instance with the passed in key
appended (separated by a dot).
Returns a new mutable document path instance with the passed in index
appended (wrapped by square brackets). Throws if index
is less than 0
or not an integer.
Increments a counter at the document's key path defined by the receiver. This will only succeed if the value at this key path is a counter, otherwise throws an exception.
The amount to increment the counter by. This can be a positive or a negative value.
Inserts a value into an array at the index defined by this key path. This will only succeed if the value at the last component of this key path is an index and the preceding key path points to an array. Otherwise throws an exception.
The value to insert into the array.
Pops a value off the end of an array at the document's key path defined by the receiver. This will only succeed if the value at this key path is an array. Otherwise throws an exception.
The value popped off from the end of the array.
Pushes a value on to the end of an array at the document's key path defined by the receiver. This will only succeed if the value at this key path is an array. Otherwise throws an exception.
The value to push on to the array.
Removes a value at the document's key path defined by the receiver. If removing an index from an array, any subsequent indexes will be shifted left to fill the gap.
Replaces a value at the document's key path defined by the receiver.
Represents whether or not the value is being replaced with
a counter that should serve as a default value. Set this to true
if you
want to set a default value that you expect to be overwritten by other
devices in the network. The default value is false
.
Sets a value at the document's key path defined by the receiver.
Represents whether or not the value should be set as a
default value. Set this to true
if you want to set a default value that
you expect to be overwritten by other devices in the network. The default
value is false
.
Traverses the document with the key path represented by the receiver and returns the corresponding object or value.
Mutable version of DocumentPath allowing you to mutate a document at a specific key path. You don't create a
MutableDocumentPath
directly but obtain one via theat()
method of MutableDocument.