Query

open class Query(source)

The Query class (and its subclass, DatabaseReference) are used for reading data. Listeners are attached, and they will be triggered when the corresponding data changes.

Instances of Query are obtained by calling startAt, endAt, or limit on a DatabaseReference.

Inheritors

Properties

Link copied to clipboard

The underlying Firebase Android SDK object.

Link copied to clipboard
open val compat: Query

The Android-SDK-shaped com.google.firebase.database.Query this wraps.

Link copied to clipboard

The underlying Firebase JS SDK database.

The underlying Firebase JS SDK database.

Link copied to clipboard
val Query.ios: FIRDatabaseQuery

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
Link copied to clipboard

The data at this location and every change to it; the flow fails if the listener is cancelled.

Functions

Link copied to clipboard
fun childEvents(vararg types: ChildEvent.Type = arrayOf(ADDED, CHANGED, MOVED, REMOVED)): Flow<ChildEvent>

The changes to the children of this location of the given types; the flow fails if the listener is cancelled.

Link copied to clipboard
fun endAt(value: Boolean, key: String? = null): Query
fun endAt(value: Double, key: String? = null): Query
fun endAt(value: String, key: String? = null): Query

Creates a query constrained to only return child nodes with a value less than or equal to the given value, using the given orderBy directive or priority as default.

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

Creates a query constrained to only return child nodes with the given value.

Link copied to clipboard
suspend fun get(): DataSnapshot

Gets the server values for this query. Updates the cache and raises events if successful. If not connected, falls back to a locally-cached value or null.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun limitToFirst(limit: Int): Query

Creates a query with limit and anchor it to the start of the window.

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

Creates a query with limit and anchor it to the end of the window.

Link copied to clipboard

Creates a query in which child nodes are ordered by the values of the specified path.

Link copied to clipboard

Creates a query in which child nodes are ordered by their keys.

Link copied to clipboard

Creates a query in which nodes are ordered by their value

Link copied to clipboard
fun startAt(value: Boolean, key: String? = null): Query
fun startAt(value: Double, key: String? = null): Query
fun startAt(value: String, key: String? = null): Query

Creates a query constrained to only return child nodes with a value greater than or equal to the given value, using the given orderBy directive or priority as default.

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