DataSnapshot

actual class DataSnapshot(source)
actual class DataSnapshot(source)
expect class DataSnapshot(source)

An immutable copy of the data at a location, as the Android SDK's DataSnapshot. value is the natural type of the data: a Map, a List, a String, a Boolean, a Long, a Double or null. A custom class is read with the reified getValue<T>() extension, which maps a @Serializable class with the Android SDK's rules on every platform; the SDK's reflective getValue(Class) and getValue(GenericTypeIndicator) are deprecated with an error on Android.

actual class DataSnapshot(source)
actual class DataSnapshot(source)
actual class DataSnapshot(source)

Properties

Link copied to clipboard

The snapshots of the children, in query order.

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

The JS SDK database the snapshot belongs to.

The JS SDK database the snapshot belongs to.

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

The underlying Firebase iOS SDK object.

Link copied to clipboard

The underlying Firebase JS SDK object.

The underlying Firebase JS 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 val priority: Any?
actual val priority: Any?
expect val priority: Any?

The priority of the location: a String, a Double or null.

actual val priority: Any?
actual val priority: Any?
actual val priority: Any?
Link copied to clipboard

The reference to the location of this snapshot.

Link copied to clipboard
actual val value: Any?
actual val value: Any?
expect val value: Any?

The data at the location as its natural type, or null.

actual val value: Any?
actual val value: Any?
actual val value: Any?

Functions

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

The snapshot of path under this location.

actual fun child(path: String): DataSnapshot
actual fun child(path: String): DataSnapshot
actual fun child(path: String): DataSnapshot
Link copied to clipboard
actual fun exists(): Boolean
actual fun exists(): Boolean
expect fun exists(): Boolean

Whether there is data at the location.

actual fun exists(): Boolean
actual fun exists(): Boolean
actual fun exists(): Boolean
Link copied to clipboard
fun <T> getValue(valueType: Class<T>): T?
actual fun getValue(useExportFormat: Boolean): Any?
actual fun getValue(useExportFormat: Boolean): Any?
expect fun getValue(useExportFormat: Boolean): Any?

The data with priorities included (.value / .priority objects) when useExportFormat is true.

actual fun getValue(useExportFormat: Boolean): Any?
fun <T> getValue(valueType: Class<T>): T?
actual fun getValue(useExportFormat: Boolean): Any?
actual fun getValue(useExportFormat: Boolean): Any?
Link copied to clipboard
inline fun <T> DataSnapshot.getValue(): T?

The SDK's reified getValue, which maps a class by reflection on Android: deprecated with an error towards com.google.firebase.serialization.getValue, which maps through FirebaseFormat.Database on every platform (see DatabaseMapping.kt for why it lives in that package).

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

The data as T, as the Android SDK's reified getValue, through the serializer of T with the Android SDK's rules (FirebaseFormat.Database, see databaseFormat) on every platform: a @Serializable class, a Map, a List or a primitive reads the same everywhere. It takes the place of the SDK's reflective getValue(Class) and of the SDK's own reified getValue<T>() (com.google.firebase.database.getValue), which is deprecated with an error.

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
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String