DittoMutableDocumentPath

class DittoMutableDocumentPath

Provides an interface to specify a path to a key in a document that you can then call various update functions on. You obtain a DittoMutableDocumentPath by subscripting a DittoMutableDocument and you can then further subscript a DittoMutableDocumentPath to further specify the key of the document that you want to update.

Functions

get
Link copied to clipboard
operator fun get(index: Int): DittoMutableDocumentPath

Used to specify an index in the array at the preceding key-path specified through the subscripting defined previously. You can subscript the return value further to access a further nested key in the document and eventually perform an update operation.

operator fun get(key: String): DittoMutableDocumentPath

Used to specify a path to a key in the document that you can subscript further to access a nested key in the document and eventually perform an update operation on.

increment
Link copied to clipboard
fun increment(amount: Number)

Increment a counter at the document's key defined by the preceding subscripting. This will only succeed if the value at the subscripting-defined key is a counter.

insert
Link copied to clipboard
fun insert(value: Any)

Inserts a value into an array at the index defined by the preceding subscripting. This will only succeed if the value at the subscripting-defined key is an index into an array.

pop
Link copied to clipboard
fun pop(): Any?

Pop a value off the end of an array at the document's key defined by the preceding subscripting. This will only succeed if the value at the subscripting-defined key is an array.

push
Link copied to clipboard
fun push(value: Any)

Push a value on to the end of an array at the document's key defined by the preceding subscripting. This will only succeed if the value at the subscripting-defined key is an array.

remove
Link copied to clipboard
fun remove()

Remove a value at the document's key defined by the preceding subscripting.

replaceWithCounter
Link copied to clipboard
fun replaceWithCounter(isDefault: Boolean = false)

Replace a value at the document's key defined by the preceding subscripting with a counter.

set
Link copied to clipboard
fun set(value: Any, isDefault: Boolean = false)

Set a value at the document's key defined by the preceding subscripting.

Properties

attachmentToken
Link copied to clipboard
val attachmentToken: DittoAttachmentToken?

Returns the value at the previously specified key in the document as a DittoAttachmentToken. If the key was invalid the return value will be null.

boolean
Link copied to clipboard
val boolean: Boolean?

Returns the value at the previously specified key in the document as a Boolean if possible, otherwise the return value will be null.

booleanValue
Link copied to clipboard
val booleanValue: Boolean

Returns the value at the previously specified key in the document as a Boolean. If the key was invalid the return value will be false.

docID
Link copied to clipboard
val docID: DittoDocumentID
double
Link copied to clipboard
val double: Double?

Returns the value at the previously specified key in the document as a Double if possible, otherwise the return value will be null.

doubleValue
Link copied to clipboard
val doubleValue: Double

Returns the value at the previously specified key in the document as a Double. If the key was invalid the return value will be 0.0.

float
Link copied to clipboard
val float: Float?

Returns the value at the previously specified key in the document as a Float if possible, otherwise the return value will be null.

floatValue
Link copied to clipboard
val floatValue: Float

Returns the value at the previously specified key in the document as a Float. If the key was invalid the return value will be 0f.

int
Link copied to clipboard
val int: Int?

Returns the value at the previously specified key in the document as an Int if possible, otherwise the return value will be null.

intValue
Link copied to clipboard
val intValue: Int

Returns the value at the previously specified key in the document as an Int. If the key was invalid the return value will be 0.

list
Link copied to clipboard
val list: List<Any?>?

Returns the value at the previously specified key in the document as a List<Any?> if possible, otherwise the return value will be null.

listValue
Link copied to clipboard
val listValue: List<Any?>

Returns the value at the previously specified key in the document as a List<Any?>. If the key was invalid the return value will be an empty list.

map
Link copied to clipboard
val map: Map<String, Any?>?

Returns the value at the previously specified key in the document as a Map<String, Any?> if possible, otherwise the return value will be null.

mapValue
Link copied to clipboard
val mapValue: Map<String, Any?>

Returns the value at the previously specified key in the document as a Map<String, Any?>. If the key was invalid the return value will be an empty dictionary.

path
Link copied to clipboard
val path: String
string
Link copied to clipboard
val string: String?

Returns the value at the previously specified key in the document as a String if possible, otherwise the return value will be null.

stringValue
Link copied to clipboard
val stringValue: String

Returns the value at the previously specified key in the document as a String. If the key was invalid the return value will be an empty string.

value
Link copied to clipboard
val value: Any?

Returns the value at the previously specified key in the document as an Any? if possible, otherwise the return value will be null