FirebaseFirestore

The entry point of Cloud Firestore, mirroring com.google.firebase.firestore.FirebaseFirestore from the Firebase Android SDK: obtained per FirebaseApp and database with the static accessors (or the Firebase.firestore extensions), it creates references, batches and transactions and manages the network and the local cache.

The loadBundle overloads taking JVM streams are declared through the error-deprecated java.io.InputStream and java.nio.ByteBuffer stand-ins, pointing common code at the kotlinx-io loadBundle(RawSource) extension (see Bundles.kt) and at loadBundle(ByteArray). The pipeline API is mirrored in Pipeline.kt and the pipeline package.

The JS SDK's Firestore must be initialised with its settings (and connected to the emulator) before any use, so the underlying object is created on first use with the settings set until then, as the Android SDK's semantics require. Instances are cached per app and database, as the Android SDK's getInstance.

The JS SDK's Firestore must be initialised with its settings (and connected to the emulator) before any use, so the underlying object is created on first use with the settings set until then, as the Android SDK's semantics require. Instances are cached per app and database, as the Android SDK's getInstance.

Types

Link copied to clipboard
actual object Companion
actual object Companion
expect object Companion
actual object Companion
actual object Companion
actual object Companion

Properties

Link copied to clipboard
actual val app: <Error class: unknown class>
actual val app: <Error class: unknown class>
expect val app: <Error class: unknown class>

The FirebaseApp this instance belongs to.

actual val app: <Error class: unknown class>
actual val app: <Error class: unknown class>
actual val app: <Error class: unknown class>
Link copied to clipboard

The iOS SDK does not expose the cache settings it was given, so the settings set through the layer are kept per instance.

The settings; can only be set before the instance is used.

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.

Functions

Link copied to clipboard
actual fun addSnapshotsInSyncListener(runnable: Runnable): ListenerRegistration
expect fun addSnapshotsInSyncListener(runnable: Runnable): ListenerRegistration

Registers runnable to be called whenever all the active snapshot listeners are in sync.

actual fun addSnapshotsInSyncListener(runnable: Runnable): ListenerRegistration
actual fun addSnapshotsInSyncListener(runnable: Runnable): ListenerRegistration
Link copied to clipboard
actual fun batch(): WriteBatch
actual fun batch(): WriteBatch
expect fun batch(): WriteBatch

A new WriteBatch.

actual fun batch(): WriteBatch
actual fun batch(): WriteBatch
actual fun batch(): WriteBatch
Link copied to clipboard
actual fun clearPersistence(): <Error class: unknown class><Nothing?>
actual fun clearPersistence(): <Error class: unknown class><Nothing?>
expect fun clearPersistence(): <Error class: unknown class><Nothing?>

Clears the persistent cache; only allowed while the instance is not started or is terminated.

actual fun clearPersistence(): <Error class: unknown class><Nothing?>
actual fun clearPersistence(): <Error class: unknown class><Nothing?>
actual fun clearPersistence(): <Error class: unknown class><Nothing?>
Link copied to clipboard
actual fun collection(collectionPath: String): CollectionReference
actual fun collection(collectionPath: String): CollectionReference
expect fun collection(collectionPath: String): CollectionReference

A CollectionReference for the collection at collectionPath.

actual fun collection(collectionPath: String): CollectionReference
actual fun collection(collectionPath: String): CollectionReference
actual fun collection(collectionPath: String): CollectionReference
Link copied to clipboard
actual fun collectionGroup(collectionId: String): Query
actual fun collectionGroup(collectionId: String): Query
expect fun collectionGroup(collectionId: String): Query

A Query over every collection named collectionId.

actual fun collectionGroup(collectionId: String): Query
actual fun collectionGroup(collectionId: String): Query
actual fun collectionGroup(collectionId: String): Query
Link copied to clipboard
actual fun disableNetwork(): <Error class: unknown class><Nothing?>
actual fun disableNetwork(): <Error class: unknown class><Nothing?>
expect fun disableNetwork(): <Error class: unknown class><Nothing?>

Disables network access; reads are served from the cache and writes are queued.

actual fun disableNetwork(): <Error class: unknown class><Nothing?>
actual fun disableNetwork(): <Error class: unknown class><Nothing?>
actual fun disableNetwork(): <Error class: unknown class><Nothing?>
Link copied to clipboard
actual fun document(documentPath: String): DocumentReference
actual fun document(documentPath: String): DocumentReference
expect fun document(documentPath: String): DocumentReference

A DocumentReference for the document at documentPath.

actual fun document(documentPath: String): DocumentReference
actual fun document(documentPath: String): DocumentReference
actual fun document(documentPath: String): DocumentReference
Link copied to clipboard
actual fun enableNetwork(): <Error class: unknown class><Nothing?>
actual fun enableNetwork(): <Error class: unknown class><Nothing?>
expect fun enableNetwork(): <Error class: unknown class><Nothing?>

Re-enables network access after disableNetwork.

actual fun enableNetwork(): <Error class: unknown class><Nothing?>
actual fun enableNetwork(): <Error class: unknown class><Nothing?>
actual fun enableNetwork(): <Error class: unknown class><Nothing?>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
actual fun getNamedQuery(name: String): <Error class: unknown class><Query?>
actual fun getNamedQuery(name: String): <Error class: unknown class><Query?>
expect fun getNamedQuery(name: String): <Error class: unknown class><Query?>

The query named name in a loaded bundle, or null.

actual fun getNamedQuery(name: String): <Error class: unknown class><Query?>
actual fun getNamedQuery(name: String): <Error class: unknown class><Query?>
actual fun getNamedQuery(name: String): <Error class: unknown class><Query?>
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
actual fun loadBundle(bundleData: InputStream): LoadBundleTask
actual fun loadBundle(bundleData: ByteBuffer): LoadBundleTask
actual fun loadBundle(bundleData: ByteArray): LoadBundleTask
actual fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask
actual fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask
actual fun loadBundle(bundleData: ByteArray): LoadBundleTask
expect fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask

Android/JVM only: loads a bundle from a java.io.InputStream; common code streams one through the kotlinx-io loadBundle(RawSource).

expect fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask

Android/JVM only: loads a bundle from a java.nio.ByteBuffer; common code passes its bytes to loadBundle.

expect fun loadBundle(bundleData: ByteArray): LoadBundleTask

Loads a Firestore bundle into the local cache.

actual fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask
actual fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask
actual fun loadBundle(bundleData: ByteArray): LoadBundleTask
actual fun loadBundle(bundleData: InputStream): LoadBundleTask
actual fun loadBundle(bundleData: ByteBuffer): LoadBundleTask
actual fun loadBundle(bundleData: ByteArray): LoadBundleTask
actual fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask
actual fun loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask
actual fun loadBundle(bundleData: ByteArray): LoadBundleTask
Link copied to clipboard
fun FirebaseFirestore.loadBundle(bundleData: <Error class: unknown class>): LoadBundleTask

Loads a Firestore bundle into the local cache as bundleData is read, closing it at the end; the kotlinx-io form of loadBundle(InputStream). On Android and the JVM the SDK reads the source as a stream, on Apple platforms as an NSInputStream and on JS through a ReadableStream, so a bundle streams on every platform.

Link copied to clipboard
actual fun pipeline(): PipelineSource
actual fun pipeline(): PipelineSource
expect fun pipeline(): PipelineSource

The source stages a Pipeline can start from.

actual fun pipeline(): PipelineSource
actual fun pipeline(): PipelineSource
actual fun pipeline(): PipelineSource
Link copied to clipboard
actual fun runBatch(batchFunction: WriteBatch.Function): <Error class: unknown class><Nothing?>
actual fun runBatch(batchFunction: WriteBatch.Function): <Error class: unknown class><Nothing?>
expect fun runBatch(batchFunction: WriteBatch.Function): <Error class: unknown class><Nothing?>

Runs batchFunction on a new WriteBatch and commits it.

actual fun runBatch(batchFunction: WriteBatch.Function): <Error class: unknown class><Nothing?>
actual fun runBatch(batchFunction: WriteBatch.Function): <Error class: unknown class><Nothing?>
actual fun runBatch(batchFunction: WriteBatch.Function): <Error class: unknown class><Nothing?>
Link copied to clipboard
actual fun <TResult> runTransaction(updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(options: TransactionOptions, updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(options: <Error class: unknown class>, updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
expect fun <TResult> runTransaction(updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>

Runs updateFunction in a transaction, retrying it on contention, and completes with its result.

expect fun <TResult> runTransaction(options: TransactionOptions, updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>

Runs updateFunction in a transaction with options and completes with its result.

actual fun <TResult> runTransaction(updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(options: <Error class: unknown class>, updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(options: TransactionOptions, updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
actual fun <TResult> runTransaction(options: <Error class: unknown class>, updateFunction: Transaction.Function<TResult>): <Error class: unknown class><TResult>
Link copied to clipboard
actual fun terminate(): <Error class: unknown class><Nothing?>
actual fun terminate(): <Error class: unknown class><Nothing?>
expect fun terminate(): <Error class: unknown class><Nothing?>

Terminates the instance; further use fails and a new instance is returned by the accessors.

actual fun terminate(): <Error class: unknown class><Nothing?>
actual fun terminate(): <Error class: unknown class><Nothing?>
actual fun terminate(): <Error class: unknown class><Nothing?>
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 useEmulator(host: String, port: Int)
actual fun useEmulator(host: String, port: Int)
expect fun useEmulator(host: String, port: Int)

Connects to the Firestore emulator at host:port; must be called before the instance is used.

actual fun useEmulator(host: String, port: Int)
actual fun useEmulator(host: String, port: Int)
actual fun useEmulator(host: String, port: Int)
Link copied to clipboard
actual fun waitForPendingWrites(): <Error class: unknown class><Nothing?>
actual fun waitForPendingWrites(): <Error class: unknown class><Nothing?>
expect fun waitForPendingWrites(): <Error class: unknown class><Nothing?>

Completes when all the pending writes have been acknowledged by the backend.

actual fun waitForPendingWrites(): <Error class: unknown class><Nothing?>
actual fun waitForPendingWrites(): <Error class: unknown class><Nothing?>
actual fun waitForPendingWrites(): <Error class: unknown class><Nothing?>