DatabaseReference

actual open class DatabaseReference : Query(source)
actual open class DatabaseReference : Query(source)
expect open class DatabaseReference : Query(source)

A location in the database that can be read and written, as the Android SDK's DatabaseReference. Values are the platform's natural types: Map, List, String, Boolean, Long and Double (and the platform SDK's own types on Apple platforms and JS). A @Serializable class is written with the setData and updateData extensions, which map it through FirebaseFormat.Database on every platform; the SDK's setValue and updateChildren, which map a class by reflection on Android, are deprecated with an error towards them.

actual open class DatabaseReference : Query(source)
actual open class DatabaseReference : Query(source)
actual open class DatabaseReference : Query(source)

Types

Link copied to clipboard
actual object Companion
actual object Companion
expect object Companion
actual object Companion
actual object Companion
actual object Companion
Link copied to clipboard
actual fun interface CompletionListener
actual fun interface CompletionListener
expect fun interface CompletionListener

Called once a write has been acknowledged by the server, or failed with DatabaseError.

actual fun interface CompletionListener
actual fun interface CompletionListener
actual fun interface CompletionListener

Properties

Link copied to clipboard

The changes to the children of this location as a Flow, which fails if the listener is cancelled.

Link copied to clipboard

The FirebaseDatabase this reference belongs to.

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

The underlying Firebase iOS SDK object.

Link copied to clipboard
open override val js: DatabaseReference

The underlying Firebase JS SDK object.

open override val js: DatabaseReference

The underlying Firebase JS SDK object.

Link copied to clipboard

The JS SDK database the query belongs to (the JS SDK does not expose it on the query).

The JS SDK database the query belongs to (the JS SDK does not expose it on the query).

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

The parent location, or null at the root.

Link copied to clipboard

The reference to the location of this query.

Link copied to clipboard

The root of the database.

Link copied to clipboard

The data at this location and every change to it as a Flow, which fails if the listener is cancelled.

Functions

Link copied to clipboard
actual fun addChildEventListener(listener: <Error class: unknown class>): <Error class: unknown class>

Adds listener for the changes to the children of this location; returns it for removeEventListener.

actual fun addChildEventListener(listener: <Error class: unknown class>): <Error class: unknown class>
actual fun addChildEventListener(listener: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard
actual fun addListenerForSingleValueEvent(listener: <Error class: unknown class>)

Calls listener once with the data at this location.

actual fun addListenerForSingleValueEvent(listener: <Error class: unknown class>)
actual fun addListenerForSingleValueEvent(listener: <Error class: unknown class>)
Link copied to clipboard
actual fun addValueEventListener(listener: <Error class: unknown class>): <Error class: unknown class>

Adds listener for the data at this location and its changes; returns it for removeEventListener.

actual fun addValueEventListener(listener: <Error class: unknown class>): <Error class: unknown class>
actual fun addValueEventListener(listener: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard
actual fun child(pathString: String): DatabaseReference
actual fun child(pathString: String): DatabaseReference
expect fun child(pathString: String): DatabaseReference

A reference to pathString under this location.

actual fun child(pathString: String): DatabaseReference
actual fun child(pathString: String): DatabaseReference
actual fun child(pathString: String): DatabaseReference
Link copied to clipboard
actual fun endAt(value: Boolean): Query
actual fun endAt(value: Double): Query
actual fun endAt(value: String?): Query
actual fun endAt(value: Boolean, key: String?): Query
actual fun endAt(value: Double, key: String?): Query
actual fun endAt(value: String?, key: String?): Query
actual fun endAt(value: Boolean): Query
actual fun endAt(value: Double): Query
actual fun endAt(value: String?): Query
actual fun endAt(value: Boolean, key: String?): Query
actual fun endAt(value: Double, key: String?): Query
actual fun endAt(value: String?, key: String?): Query
expect fun endAt(value: Boolean): Query
expect fun endAt(value: Double): Query
expect fun endAt(value: Boolean, key: String?): Query
expect fun endAt(value: Double, key: String?): Query

expect fun endAt(value: String?): Query

Limits the results to the children whose ordered value is at most value.

expect fun endAt(value: String?, key: String?): Query

Limits the results to the children whose ordered value is at most value, breaking ties by key.

actual fun endAt(value: Boolean): Query
actual fun endAt(value: Double): Query
actual fun endAt(value: String?): Query
actual fun endAt(value: Boolean, key: String?): Query
actual fun endAt(value: Double, key: String?): Query
actual fun endAt(value: String?, key: String?): Query
actual fun endAt(value: Boolean): Query
actual fun endAt(value: Double): Query
actual fun endAt(value: String?): Query
actual fun endAt(value: Boolean, key: String?): Query
actual fun endAt(value: Double, key: String?): Query
actual fun endAt(value: String?, key: String?): Query
actual fun endAt(value: Boolean): Query
actual fun endAt(value: Double): Query
actual fun endAt(value: String?): Query
actual fun endAt(value: Boolean, key: String?): Query
actual fun endAt(value: Double, key: String?): Query
actual fun endAt(value: String?, key: String?): Query
Link copied to clipboard
actual fun endBefore(value: Boolean): Query
actual fun endBefore(value: Double): Query
actual fun endBefore(value: String?): Query
actual fun endBefore(value: Boolean, key: String?): Query
actual fun endBefore(value: Double, key: String?): Query
actual fun endBefore(value: String?, key: String?): Query
actual fun endBefore(value: Boolean): Query
actual fun endBefore(value: Double): Query
actual fun endBefore(value: String?): Query
actual fun endBefore(value: Boolean, key: String?): Query
actual fun endBefore(value: Double, key: String?): Query
actual fun endBefore(value: String?, key: String?): Query
expect fun endBefore(value: Boolean): Query
expect fun endBefore(value: Double): Query
expect fun endBefore(value: Boolean, key: String?): Query
expect fun endBefore(value: Double, key: String?): Query

expect fun endBefore(value: String?): Query

Limits the results to the children whose ordered value is less than value.

expect fun endBefore(value: String?, key: String?): Query

Limits the results to the children whose ordered value is less than value, breaking ties by key.

actual fun endBefore(value: Boolean): Query
actual fun endBefore(value: Double): Query
actual fun endBefore(value: String?): Query
actual fun endBefore(value: Boolean, key: String?): Query
actual fun endBefore(value: Double, key: String?): Query
actual fun endBefore(value: String?, key: String?): Query
actual fun endBefore(value: Boolean): Query
actual fun endBefore(value: Double): Query
actual fun endBefore(value: String?): Query
actual fun endBefore(value: Boolean, key: String?): Query
actual fun endBefore(value: Double, key: String?): Query
actual fun endBefore(value: String?, key: String?): Query
actual fun endBefore(value: Boolean): Query
actual fun endBefore(value: Double): Query
actual fun endBefore(value: String?): Query
actual fun endBefore(value: Boolean, key: String?): Query
actual fun endBefore(value: Double, key: String?): Query
actual fun endBefore(value: String?, key: String?): Query
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

The iOS SDK creates a new object per call, so queries are equal when they describe the same location and constraints.

open operator override fun equals(other: Any?): Boolean

The JS SDK creates a new object per call, so queries are equal when they are of the same location and constraints.

open operator override fun equals(other: Any?): Boolean

The JS SDK creates a new object per call, so queries are equal when they are of the same location and constraints.

Link copied to clipboard
actual fun equalTo(value: Boolean): Query
actual fun equalTo(value: Double): Query
actual fun equalTo(value: String?): Query
actual fun equalTo(value: Boolean, key: String?): Query
actual fun equalTo(value: Double, key: String?): Query
actual fun equalTo(value: String?, key: String?): Query
actual fun equalTo(value: Boolean): Query
actual fun equalTo(value: Double): Query
actual fun equalTo(value: String?): Query
actual fun equalTo(value: Boolean, key: String?): Query
actual fun equalTo(value: Double, key: String?): Query
actual fun equalTo(value: String?, key: String?): Query
expect fun equalTo(value: Boolean): Query
expect fun equalTo(value: Double): Query
expect fun equalTo(value: Boolean, key: String?): Query
expect fun equalTo(value: Double, key: String?): Query

expect fun equalTo(value: String?): Query

Limits the results to the children whose ordered value equals value.

expect fun equalTo(value: String?, key: String?): Query

Limits the results to the child whose ordered value equals value and whose key is key.

actual fun equalTo(value: Boolean): Query
actual fun equalTo(value: Double): Query
actual fun equalTo(value: String?): Query
actual fun equalTo(value: Boolean, key: String?): Query
actual fun equalTo(value: Double, key: String?): Query
actual fun equalTo(value: String?, key: String?): Query
actual fun equalTo(value: Boolean): Query
actual fun equalTo(value: Double): Query
actual fun equalTo(value: String?): Query
actual fun equalTo(value: Boolean, key: String?): Query
actual fun equalTo(value: Double, key: String?): Query
actual fun equalTo(value: String?, key: String?): Query
actual fun equalTo(value: Boolean): Query
actual fun equalTo(value: Double): Query
actual fun equalTo(value: String?): Query
actual fun equalTo(value: Boolean, key: String?): Query
actual fun equalTo(value: Double, key: String?): Query
actual fun equalTo(value: String?, key: String?): Query
Link copied to clipboard
actual fun get(): <Error class: unknown class><DataSnapshot>
actual fun get(): <Error class: unknown class><DataSnapshot>
expect fun get(): <Error class: unknown class><DataSnapshot>

Reads the data at this location from the server, falling back to the cache when offline.

actual fun get(): <Error class: unknown class><DataSnapshot>
actual fun get(): <Error class: unknown class><DataSnapshot>
actual fun get(): <Error class: unknown class><DataSnapshot>
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): Int
Link copied to clipboard
actual fun keepSynced(keepSynced: Boolean)
actual fun keepSynced(keepSynced: Boolean)
expect fun keepSynced(keepSynced: Boolean)

Keeps the data of this query synchronized in the persistent cache, even while it has no listener. A no-op on JS, whose SDK has no persistent cache.

actual fun keepSynced(keepSynced: Boolean)

A no-op: the JS SDK has no persistent cache to keep a query synchronized in.

actual fun keepSynced(keepSynced: Boolean)
actual fun keepSynced(keepSynced: Boolean)

A no-op: the JS SDK has no persistent cache to keep a query synchronized in.

Link copied to clipboard
actual fun limitToFirst(limit: Int): Query
actual fun limitToFirst(limit: Int): Query
expect fun limitToFirst(limit: Int): Query

Limits the results to the first limit children.

actual fun limitToFirst(limit: Int): Query
actual fun limitToFirst(limit: Int): Query
actual fun limitToFirst(limit: Int): Query
Link copied to clipboard
actual fun limitToLast(limit: Int): Query
actual fun limitToLast(limit: Int): Query
expect fun limitToLast(limit: Int): Query

Limits the results to the last limit children.

actual fun limitToLast(limit: Int): Query
actual fun limitToLast(limit: Int): Query
actual fun limitToLast(limit: Int): Query
Link copied to clipboard

The disconnect operations of this location.

Link copied to clipboard
actual fun orderByChild(path: String): Query
actual fun orderByChild(path: String): Query
expect fun orderByChild(path: String): Query

Orders the children by the value at path within each of them.

actual fun orderByChild(path: String): Query
actual fun orderByChild(path: String): Query
actual fun orderByChild(path: String): Query
Link copied to clipboard
actual fun orderByKey(): Query
actual fun orderByKey(): Query
expect fun orderByKey(): Query

Orders the children by their keys.

actual fun orderByKey(): Query
actual fun orderByKey(): Query
actual fun orderByKey(): Query
Link copied to clipboard
actual fun orderByPriority(): Query
actual fun orderByPriority(): Query
expect fun orderByPriority(): Query

Orders the children by their priorities.

actual fun orderByPriority(): Query
actual fun orderByPriority(): Query
actual fun orderByPriority(): Query
Link copied to clipboard
actual fun orderByValue(): Query
actual fun orderByValue(): Query
expect fun orderByValue(): Query

Orders the children by their values.

actual fun orderByValue(): Query
actual fun orderByValue(): Query
actual fun orderByValue(): Query
Link copied to clipboard
actual fun push(): DatabaseReference
actual fun push(): DatabaseReference
expect fun push(): DatabaseReference

A reference to a new child with a unique, chronologically ordered key.

actual fun push(): DatabaseReference
actual fun push(): DatabaseReference
actual fun push(): DatabaseReference
Link copied to clipboard
actual fun removeEventListener(listener: <Error class: unknown class>)
actual fun removeEventListener(listener: <Error class: unknown class>)

Removes a listener added with addChildEventListener.

Removes a listener added with addValueEventListener.

actual fun removeEventListener(listener: <Error class: unknown class>)
actual fun removeEventListener(listener: <Error class: unknown class>)
actual fun removeEventListener(listener: <Error class: unknown class>)
actual fun removeEventListener(listener: <Error class: unknown class>)
Link copied to clipboard
actual fun removeValue(): <Error class: unknown class><Nothing?>
actual fun removeValue(): <Error class: unknown class><Nothing?>
expect fun removeValue(): <Error class: unknown class><Nothing?>

Deletes the data at this location.

Deletes the data at this location and calls listener once the server has acknowledged it.

actual fun removeValue(): <Error class: unknown class><Nothing?>
actual fun removeValue(): <Error class: unknown class><Nothing?>
actual fun removeValue(): <Error class: unknown class><Nothing?>
Link copied to clipboard
actual fun runTransaction(handler: Transaction.Handler)
actual fun runTransaction(handler: Transaction.Handler, fireLocalEvents: Boolean)
actual fun runTransaction(handler: Transaction.Handler)
actual fun runTransaction(handler: Transaction.Handler, fireLocalEvents: Boolean)
expect fun runTransaction(handler: Transaction.Handler)

Runs handler as a transaction on this location, retrying it while the data changes; events fire for local updates.

expect fun runTransaction(handler: Transaction.Handler, fireLocalEvents: Boolean)

Runs handler as a transaction on this location; fireLocalEvents controls the events of intermediate states.

actual fun runTransaction(handler: Transaction.Handler)
actual fun runTransaction(handler: Transaction.Handler, fireLocalEvents: Boolean)
actual fun runTransaction(handler: Transaction.Handler)
actual fun runTransaction(handler: Transaction.Handler, fireLocalEvents: Boolean)
actual fun runTransaction(handler: Transaction.Handler)
actual fun runTransaction(handler: Transaction.Handler, fireLocalEvents: Boolean)
Link copied to clipboard
inline fun <T> DatabaseReference.setData(value: T): <Error class: unknown class><Nothing?>

Writes value, a plain value or a @Serializable class, to this location (see DatabaseReference.setValue). The value is mapped by the format with its static type, so a generic class maps too; an Any maps by its runtime type.

Writes value (see setData) and calls listener with the outcome.

inline fun <T> DatabaseReference.setData(value: T, priority: Any?): <Error class: unknown class><Nothing?>

Writes value (see setData) with priority.

inline fun <T> DatabaseReference.setData(value: T, priority: Any?, listener: DatabaseReference.CompletionListener?)

Writes value (see setData) with priority and calls listener with the outcome.

Link copied to clipboard
actual fun setPriority(priority: Any?): <Error class: unknown class><Nothing?>
actual fun setPriority(priority: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setPriority(priority: Any?): <Error class: unknown class><Nothing?>
actual fun setPriority(priority: Any?, listener: DatabaseReference.CompletionListener?)
expect fun setPriority(priority: Any?): <Error class: unknown class><Nothing?>

Sets the priority of this location, a String, a Double or null.

expect fun setPriority(priority: Any?, listener: DatabaseReference.CompletionListener?)

Sets the priority of this location and calls listener once the server has acknowledged it.

actual fun setPriority(priority: Any?): <Error class: unknown class><Nothing?>
actual fun setPriority(priority: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setPriority(priority: Any?): <Error class: unknown class><Nothing?>
actual fun setPriority(priority: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setPriority(priority: Any?): <Error class: unknown class><Nothing?>
actual fun setPriority(priority: Any?, listener: DatabaseReference.CompletionListener?)
Link copied to clipboard
actual fun setValue(value: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?, priority: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, priority: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?, priority: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, priority: Any?, listener: DatabaseReference.CompletionListener?)
expect fun setValue(value: Any?): <Error class: unknown class><Nothing?>

Writes value at this location, replacing the current data; null deletes it.

expect fun setValue(value: Any?, listener: DatabaseReference.CompletionListener?)

Writes value at this location and calls listener once the server has acknowledged it.

expect fun setValue(value: Any?, priority: Any?): <Error class: unknown class><Nothing?>

Writes value with priority at this location.

expect fun setValue(value: Any?, priority: Any?, listener: DatabaseReference.CompletionListener?)

Writes value with priority at this location and calls listener once the server has acknowledged it.

actual fun setValue(value: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?, priority: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, priority: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?, priority: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, priority: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, listener: DatabaseReference.CompletionListener?)
actual fun setValue(value: Any?, priority: Any?): <Error class: unknown class><Nothing?>
actual fun setValue(value: Any?, priority: Any?, listener: DatabaseReference.CompletionListener?)
Link copied to clipboard
actual fun startAfter(value: Boolean): Query
actual fun startAfter(value: Double): Query
actual fun startAfter(value: String?): Query
actual fun startAfter(value: Boolean, key: String?): Query
actual fun startAfter(value: Double, key: String?): Query
actual fun startAfter(value: String?, key: String?): Query
actual fun startAfter(value: Boolean): Query
actual fun startAfter(value: Double): Query
actual fun startAfter(value: String?): Query
actual fun startAfter(value: Boolean, key: String?): Query
actual fun startAfter(value: Double, key: String?): Query
actual fun startAfter(value: String?, key: String?): Query
expect fun startAfter(value: Boolean): Query
expect fun startAfter(value: Double): Query
expect fun startAfter(value: Boolean, key: String?): Query
expect fun startAfter(value: Double, key: String?): Query

expect fun startAfter(value: String?): Query

Limits the results to the children whose ordered value is greater than value.

expect fun startAfter(value: String?, key: String?): Query

Limits the results to the children whose ordered value is greater than value, breaking ties by key.

actual fun startAfter(value: Boolean): Query
actual fun startAfter(value: Double): Query
actual fun startAfter(value: String?): Query
actual fun startAfter(value: Boolean, key: String?): Query
actual fun startAfter(value: Double, key: String?): Query
actual fun startAfter(value: String?, key: String?): Query
actual fun startAfter(value: Boolean): Query
actual fun startAfter(value: Double): Query
actual fun startAfter(value: String?): Query
actual fun startAfter(value: Boolean, key: String?): Query
actual fun startAfter(value: Double, key: String?): Query
actual fun startAfter(value: String?, key: String?): Query
actual fun startAfter(value: Boolean): Query
actual fun startAfter(value: Double): Query
actual fun startAfter(value: String?): Query
actual fun startAfter(value: Boolean, key: String?): Query
actual fun startAfter(value: Double, key: String?): Query
actual fun startAfter(value: String?, key: String?): Query
Link copied to clipboard
actual fun startAt(value: Boolean): Query
actual fun startAt(value: Double): Query
actual fun startAt(value: String?): Query
actual fun startAt(value: Boolean, key: String?): Query
actual fun startAt(value: Double, key: String?): Query
actual fun startAt(value: String?, key: String?): Query
actual fun startAt(value: Boolean): Query
actual fun startAt(value: Double): Query
actual fun startAt(value: String?): Query
actual fun startAt(value: Boolean, key: String?): Query
actual fun startAt(value: Double, key: String?): Query
actual fun startAt(value: String?, key: String?): Query
expect fun startAt(value: Boolean): Query
expect fun startAt(value: Double): Query
expect fun startAt(value: Boolean, key: String?): Query
expect fun startAt(value: Double, key: String?): Query

expect fun startAt(value: String?): Query

Limits the results to the children whose ordered value is at least value.

expect fun startAt(value: String?, key: String?): Query

Limits the results to the children whose ordered value is at least value, breaking ties by key.

actual fun startAt(value: Boolean): Query
actual fun startAt(value: Double): Query
actual fun startAt(value: String?): Query
actual fun startAt(value: Boolean, key: String?): Query
actual fun startAt(value: Double, key: String?): Query
actual fun startAt(value: String?, key: String?): Query
actual fun startAt(value: Boolean): Query
actual fun startAt(value: Double): Query
actual fun startAt(value: String?): Query
actual fun startAt(value: Boolean, key: String?): Query
actual fun startAt(value: Double, key: String?): Query
actual fun startAt(value: String?, key: String?): Query
actual fun startAt(value: Boolean): Query
actual fun startAt(value: Double): Query
actual fun startAt(value: String?): Query
actual fun startAt(value: Boolean, key: String?): Query
actual fun startAt(value: Double, key: String?): Query
actual fun startAt(value: String?, key: String?): Query
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
Link copied to clipboard
actual fun updateChildren(update: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun updateChildren(update: Map<String, Any?>): <Error class: unknown class><Nothing?>
expect fun updateChildren(update: Map<String, Any?>): <Error class: unknown class><Nothing?>

Writes the children in update (paths to values; a null value deletes) without replacing the other children.

Writes the children in update and calls listener once the server has acknowledged it.

actual fun updateChildren(update: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun updateChildren(update: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun updateChildren(update: Map<String, Any?>): <Error class: unknown class><Nothing?>
Link copied to clipboard
fun DatabaseReference.updateData(update: Map<String, Any?>): <Error class: unknown class><Nothing?>

Updates the children in update, each a plain value or a @Serializable class mapped by the format (see DatabaseReference.updateChildren).

Updates the children in update (see updateData) and calls listener with the outcome.

Link copied to clipboard
inline fun <T> Query.values(): Flow<T?>

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

inline fun <T> Query.values(): Flow<T?>

The data at this location as T (see DataSnapshot.getValue) and every change to it as a Flow, as the Android SDK's values.