MutableData

actual class MutableData(source)
actual class MutableData(source)
expect class MutableData(source)

The data of a location inside a transaction, as the Android SDK's MutableData: value is read and then set to the new data before the Transaction.Handler returns Transaction.success.

actual class MutableData(source)

The data of a transaction as a JS value tree: the JS SDK's transaction receives the current value and returns the new one, so root holds the value being edited and each child refers to a path in it. A node with a priority is held in the SDK's { ".value": data, ".priority": priority } form, which every operation looks through. The tree is read and written through own properties only, so that a path such as __proto__ cannot reach the prototype chain.

actual class MutableData(source)
actual class MutableData(source)

The data of a transaction as a JS value tree: the JS SDK's transaction receives the current value and returns the new one, so root holds the value being edited and each child refers to a path in it. A node with a priority is held in the SDK's { ".value": data, ".priority": priority } form, which every operation looks through. The tree is read and written through own properties only, so that a path such as __proto__ cannot reach the prototype chain.

Properties

Link copied to clipboard

The children of this location.

Link copied to clipboard
actual val childrenCount: Long
actual val childrenCount: Long
expect val childrenCount: Long

The number of children.

actual val childrenCount: Long
actual val childrenCount: Long
actual val childrenCount: Long
Link copied to clipboard
val ios: <Error class: unknown class>

The underlying Firebase iOS SDK object.

Link copied to clipboard
actual val key: String?
actual val key: String?
expect val key: String?

The last segment of the path, or null at the root.

actual val key: String?
actual val key: String?
actual val key: String?
Link copied to clipboard
actual var priority: Any?
actual var priority: Any?
expect var priority: Any?

The priority of the location; setting it changes the priority written by the transaction.

actual var priority: Any?
actual var priority: Any?
actual var priority: Any?
Link copied to clipboard
actual var value: Any?
actual var value: Any?
expect var value: Any?

The current data as its natural type (see DataSnapshot); setting it replaces the data of the transaction. The setter, which maps a class by reflection on Android, is deprecated with an error towards setData, which maps a @Serializable class through FirebaseFormat.Database on every platform.

actual var value: Any?
actual var value: Any?
actual var value: Any?

Functions

Link copied to clipboard
actual fun child(path: String): MutableData
actual fun child(path: String): MutableData
expect fun child(path: String): MutableData

The data of path under this location; changes to it are part of the transaction.

actual fun child(path: String): MutableData
actual fun child(path: String): MutableData
actual fun child(path: String): MutableData
Link copied to clipboard
fun <T> getValue(valueType: Class<T>): T?
fun <T> getValue(valueType: Class<T>): T?
Link copied to clipboard
inline fun <T> MutableData.getValue(): T?

The SDK's reified getValue (see DataSnapshot.getValue); deprecated towards com.google.firebase.serialization.getValue.

inline fun <T> MutableData.getValue(): T?

The data as T, as the Android SDK's reified getValue (see DataSnapshot.getValue).

Link copied to clipboard
actual fun hasChild(path: String): Boolean
actual fun hasChild(path: String): Boolean
expect fun hasChild(path: String): Boolean

Whether there is data at path under this location.

actual fun hasChild(path: String): Boolean
actual fun hasChild(path: String): Boolean
actual fun hasChild(path: String): Boolean
Link copied to clipboard
actual fun hasChildren(): Boolean
actual fun hasChildren(): Boolean
expect fun hasChildren(): Boolean

Whether the location has children.

actual fun hasChildren(): Boolean
actual fun hasChildren(): Boolean
actual fun hasChildren(): Boolean
Link copied to clipboard
inline fun <T> MutableData.setData(value: T)

Replaces the data of the transaction with value, a plain value or a @Serializable class mapped by the format (see MutableData.value).

Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String