DocumentReference

A document location, mirroring com.google.firebase.firestore.DocumentReference from the Firebase Android SDK: the document may or may not exist; reads, writes and listeners are performed through it. A @Serializable class is written with the setData and updateData extensions, which map it through FirebaseFormat.Firestore on every platform; the SDK's set and update(Map), which map a class by reflection on Android, are deprecated with an error towards them.

Not mirrored: the Activity and Executor overloads of addSnapshotListener (see api/android-sdk/exclusions.txt).

Properties

Link copied to clipboard

The FirebaseFirestore this reference belongs to.

Link copied to clipboard
actual val id: String
actual val id: String
expect val id: String

The last segment of the path: the document id.

actual val id: String
actual val id: String
actual val id: String
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

The collection containing this document.

Link copied to clipboard
actual val path: String
actual val path: String
expect val path: String

The path from the root, /-separated.

actual val path: String
actual val path: String
actual val path: String

Functions

Link copied to clipboard

Not in the common API (the executor is Android-only); the dev.gitlive layer's Android listeners bind to this member.

actual fun addSnapshotListener(listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
actual fun addSnapshotListener(metadataChanges: <Error class: unknown class>, listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
actual fun addSnapshotListener(options: <Error class: unknown class>, listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>

Listens to the document and every change to it.

Listens to the document, also notifying listener of metadata changes when metadataChanges is INCLUDE.

Listens to the document with options.

actual fun addSnapshotListener(listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
actual fun addSnapshotListener(metadataChanges: <Error class: unknown class>, listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
actual fun addSnapshotListener(options: <Error class: unknown class>, listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>

Not in the common API (the executor is Android-only); the dev.gitlive layer's Android listeners bind to this member.

actual fun addSnapshotListener(listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
actual fun addSnapshotListener(metadataChanges: <Error class: unknown class>, listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
actual fun addSnapshotListener(options: <Error class: unknown class>, listener: <Error class: unknown class><DocumentSnapshot>): <Error class: unknown class>
Link copied to clipboard
actual fun collection(collectionPath: String): CollectionReference
actual fun collection(collectionPath: String): CollectionReference
expect fun collection(collectionPath: String): CollectionReference

The subcollection at collectionPath, relative to this document.

actual fun collection(collectionPath: String): CollectionReference
actual fun collection(collectionPath: String): CollectionReference
actual fun collection(collectionPath: String): CollectionReference
Link copied to clipboard
inline fun <T> DocumentReference.dataObjects(metadataChanges: MetadataChanges = MetadataChanges.EXCLUDE): Flow<T?>

The SDK's dataObjects flow; deprecated towards com.google.firebase.serialization.dataObjects.

inline fun <T> DocumentReference.dataObjects(metadataChanges: MetadataChanges = MetadataChanges.EXCLUDE): Flow<T?>

The document data as T (see toObject) and every change to it as a Flow, as the Android SDK's dataObjects.

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

Deletes the document.

actual fun delete(): <Error class: unknown class><Nothing?>
actual fun delete(): <Error class: unknown class><Nothing?>
actual fun delete(): <Error class: unknown class><Nothing?>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
actual fun get(): <Error class: unknown class><DocumentSnapshot>
actual fun get(source: Source): <Error class: unknown class><DocumentSnapshot>
actual fun get(): <Error class: unknown class><DocumentSnapshot>
actual fun get(source: <Error class: unknown class>): <Error class: unknown class><DocumentSnapshot>
expect fun get(): <Error class: unknown class><DocumentSnapshot>

Reads the document, from the cache and the backend as available.

expect fun get(source: Source): <Error class: unknown class><DocumentSnapshot>

Reads the document from source.

actual fun get(): <Error class: unknown class><DocumentSnapshot>
actual fun get(source: <Error class: unknown class>): <Error class: unknown class><DocumentSnapshot>
actual fun get(): <Error class: unknown class><DocumentSnapshot>
actual fun get(source: Source): <Error class: unknown class><DocumentSnapshot>
actual fun get(): <Error class: unknown class><DocumentSnapshot>
actual fun get(source: <Error class: unknown class>): <Error class: unknown class><DocumentSnapshot>
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 set(data: Any): <Error class: unknown class><Nothing?>
actual fun set(data: Any, options: SetOptions): <Error class: unknown class><Nothing?>
actual fun set(data: Any): <Error class: unknown class><Nothing?>
actual fun set(data: Any, options: SetOptions): <Error class: unknown class><Nothing?>
expect fun set(data: Any): <Error class: unknown class><Nothing?>

Writes data (a map of field values), replacing the document.

expect fun set(data: Any, options: SetOptions): <Error class: unknown class><Nothing?>

Writes data (a map of field values) according to options.

actual fun set(data: Any): <Error class: unknown class><Nothing?>
actual fun set(data: Any, options: SetOptions): <Error class: unknown class><Nothing?>
actual fun set(data: Any): <Error class: unknown class><Nothing?>
actual fun set(data: Any, options: SetOptions): <Error class: unknown class><Nothing?>
actual fun set(data: Any): <Error class: unknown class><Nothing?>
actual fun set(data: Any, options: SetOptions): <Error class: unknown class><Nothing?>
Link copied to clipboard
inline fun <T : Any> DocumentReference.setData(data: T): <Error class: unknown class><Nothing?>

Writes data, a map of field values or a @Serializable class, replacing the document (see DocumentReference.set). The data is mapped by the format with its static type, so a generic class maps too; an Any maps by its runtime type.

inline fun <T : Any> DocumentReference.setData(data: T, options: SetOptions): <Error class: unknown class><Nothing?>

Writes data (see setData) according to options.

Link copied to clipboard
fun DocumentReference.snapshots(metadataChanges: MetadataChanges = MetadataChanges.EXCLUDE): Flow<DocumentSnapshot>

The document and every change to it as a Flow, which fails if the listener fails.

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 update(data: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun update(fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(field: String, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(data: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun update(fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(field: String, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
expect fun update(data: Map<String, Any?>): <Error class: unknown class><Nothing?>

Updates the fields in data; fails if the document does not exist.

expect fun update(fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>

Updates fieldPath to value and the further field path/value pairs in moreFieldsAndValues.

expect fun update(field: String, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>

Updates field to value and the further field/value pairs in moreFieldsAndValues.

actual fun update(data: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun update(fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(field: String, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(data: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun update(fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(field: String, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(data: Map<String, Any?>): <Error class: unknown class><Nothing?>
actual fun update(fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
actual fun update(field: String, value: Any?, vararg moreFieldsAndValues: Any?): <Error class: unknown class><Nothing?>
Link copied to clipboard
fun DocumentReference.updateData(data: Map<String, Any?>): <Error class: unknown class><Nothing?>

Updates the fields in data, each a field value or a @Serializable class mapped by the format (see DocumentReference.update).