QueryDocumentSnapshot

A DocumentSnapshot from a query, which is guaranteed to exist.

Properties

Link copied to clipboard
actual val data: Map<String, Any?>?
actual val data: Map<String, Any?>?
expect val data: Map<String, Any?>?

The fields as a map, or null when the document does not exist.

actual val data: Map<String, Any?>?
actual val data: Map<String, Any?>?
actual val data: Map<String, Any?>?
Link copied to clipboard
actual val id: String
actual val id: String
expect val id: String

The document id.

actual val id: String
actual val id: String
actual val id: String
Link copied to clipboard
open override 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

Whether the snapshot is from the cache or has pending writes.

Link copied to clipboard

The reference of the document.

Functions

Link copied to clipboard
actual fun contains(fieldPath: FieldPath): Boolean
actual fun contains(field: String): Boolean
actual fun contains(fieldPath: FieldPath): Boolean
actual fun contains(field: String): Boolean
expect fun contains(fieldPath: FieldPath): Boolean

Whether the document has fieldPath.

expect fun contains(field: String): Boolean

Whether the document has field (a .-separated path).

actual fun contains(fieldPath: FieldPath): Boolean
actual fun contains(field: String): Boolean
actual fun contains(fieldPath: FieldPath): Boolean
actual fun contains(field: String): Boolean
actual fun contains(fieldPath: FieldPath): Boolean
actual fun contains(field: String): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean

The JS SDK creates a new object per read, so snapshots are equal when they are of the same document and data.

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

The JS SDK creates a new object per read, so snapshots are equal when they are of the same document and data.

Link copied to clipboard
actual fun exists(): Boolean
actual fun exists(): Boolean
expect fun exists(): Boolean

Whether the document exists.

actual fun exists(): Boolean
actual fun exists(): Boolean
actual fun exists(): Boolean
Link copied to clipboard
actual fun get(fieldPath: FieldPath): Any?
actual fun get(field: String): Any?
actual fun get(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
fun <T> get(fieldPath: FieldPath, valueType: Class<T>): T?
actual fun get(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
fun <T> get(field: String, valueType: Class<T>): T?
fun <T> get(fieldPath: FieldPath, valueType: Class<T>, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?
fun <T> get(field: String, valueType: Class<T>, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?
actual fun get(fieldPath: FieldPath): Any?
actual fun get(field: String): Any?
actual fun get(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
actual fun get(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
expect fun get(fieldPath: FieldPath): Any?

The value of fieldPath, or null.

expect fun get(field: String): Any?

The value of field (a .-separated path), or null.

expect fun get(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?

The value of fieldPath with server timestamps resolved per serverTimestampBehavior.

expect fun get(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?

The value of field with server timestamps resolved per serverTimestampBehavior.

actual fun get(fieldPath: FieldPath): Any?
actual fun get(field: String): Any?
actual fun get(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
actual fun get(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
actual fun get(fieldPath: FieldPath): Any?
actual fun get(field: String): Any?
actual fun get(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
fun <T> get(fieldPath: FieldPath, valueType: Class<T>): T?
actual fun get(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
fun <T> get(field: String, valueType: Class<T>): T?
fun <T> get(fieldPath: FieldPath, valueType: Class<T>, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?
fun <T> get(field: String, valueType: Class<T>, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?
actual fun get(fieldPath: FieldPath): Any?
actual fun get(field: String): Any?
actual fun get(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
actual fun get(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Any?
Link copied to clipboard
actual fun getBlob(field: String): Blob?
actual fun getBlob(field: String): Blob?
expect fun getBlob(field: String): Blob?
actual fun getBlob(field: String): Blob?
actual fun getBlob(field: String): Blob?
actual fun getBlob(field: String): Blob?
Link copied to clipboard
actual fun getBoolean(field: String): Boolean?
actual fun getBoolean(field: String): Boolean?
expect fun getBoolean(field: String): Boolean?
actual fun getBoolean(field: String): Boolean?
actual fun getBoolean(field: String): Boolean?
actual fun getBoolean(field: String): Boolean?
Link copied to clipboard
actual fun getData(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Map<String, Any?>?
actual fun getData(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Map<String, Any?>?
expect fun getData(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Map<String, Any?>?

The fields as a map with server timestamps resolved per serverTimestampBehavior, or null when the document does not exist.

actual fun getData(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Map<String, Any?>?
actual fun getData(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Map<String, Any?>?
actual fun getData(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): Map<String, Any?>?
Link copied to clipboard
actual fun getDate(field: String): <Error class: unknown class>?
actual fun getDate(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getDate(field: String): <Error class: unknown class>?
actual fun getDate(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
expect fun getDate(field: String): <Error class: unknown class>?

Android/JVM only: the value of field as a java.util.Date; common code uses getTimestamp and toKotlinInstant().

expect fun getDate(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?

Android/JVM only (see getDate).

actual fun getDate(field: String): <Error class: unknown class>?
actual fun getDate(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getDate(field: String): <Error class: unknown class>?
actual fun getDate(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getDate(field: String): <Error class: unknown class>?
actual fun getDate(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
Link copied to clipboard
Link copied to clipboard
actual fun getDouble(field: String): Double?
actual fun getDouble(field: String): Double?
expect fun getDouble(field: String): Double?
actual fun getDouble(field: String): Double?
actual fun getDouble(field: String): Double?
actual fun getDouble(field: String): Double?
Link copied to clipboard
inline fun <T> DocumentSnapshot.getField(fieldPath: FieldPath): T?
inline fun <T> DocumentSnapshot.getField(field: String): T?
inline fun <T> DocumentSnapshot.getField(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?
inline fun <T> DocumentSnapshot.getField(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?

The SDK's reified getField; deprecated towards com.google.firebase.serialization.getField.

inline fun <T> DocumentSnapshot.getField(fieldPath: FieldPath): T?
inline fun <T> DocumentSnapshot.getField(fieldPath: FieldPath, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?

The value of fieldPath as T (see getField).

inline fun <T> DocumentSnapshot.getField(field: String): T?

The value of field as T, as the Android SDK's reified getField, through the serializer of T with the Android SDK's rules (FirebaseFormat.Firestore, see firestoreFormat) on every platform; Any stands for the value as it is. It takes the place of the SDK's reflective get(String, Class) and of the SDK's own reified getField<T>() (com.google.firebase.firestore.getField), which is deprecated with an error.

inline fun <T> DocumentSnapshot.getField(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?

The value of field as T (see getField).

Link copied to clipboard
actual fun getGeoPoint(field: String): GeoPoint?
actual fun getGeoPoint(field: String): GeoPoint?
expect fun getGeoPoint(field: String): GeoPoint?
actual fun getGeoPoint(field: String): GeoPoint?
actual fun getGeoPoint(field: String): GeoPoint?
actual fun getGeoPoint(field: String): GeoPoint?
Link copied to clipboard
actual fun getLong(field: String): Long?
actual fun getLong(field: String): Long?
expect fun getLong(field: String): Long?
actual fun getLong(field: String): Long?
actual fun getLong(field: String): Long?
actual fun getLong(field: String): Long?
Link copied to clipboard
actual fun getString(field: String): String?
actual fun getString(field: String): String?
expect fun getString(field: String): String?
actual fun getString(field: String): String?
actual fun getString(field: String): String?
actual fun getString(field: String): String?
Link copied to clipboard
actual fun getTimestamp(field: String): <Error class: unknown class>?
actual fun getTimestamp(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getTimestamp(field: String): <Error class: unknown class>?
actual fun getTimestamp(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
expect fun getTimestamp(field: String): <Error class: unknown class>?
expect fun getTimestamp(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getTimestamp(field: String): <Error class: unknown class>?
actual fun getTimestamp(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getTimestamp(field: String): <Error class: unknown class>?
actual fun getTimestamp(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
actual fun getTimestamp(field: String): <Error class: unknown class>?
actual fun getTimestamp(field: String, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): <Error class: unknown class>?
Link copied to clipboard
actual fun getVectorValue(field: String): VectorValue?
actual fun getVectorValue(field: String): VectorValue?
expect fun getVectorValue(field: String): VectorValue?

The value of field as a VectorValue, or null when absent.

actual fun getVectorValue(field: String): VectorValue?
actual fun getVectorValue(field: String): VectorValue?
actual fun getVectorValue(field: String): VectorValue?
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): Int
Link copied to clipboard
open override fun <T> toObject(valueType: Class<T>): T
open override fun <T> toObject(valueType: Class<T>, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T
open override fun <T> toObject(valueType: Class<T>): T
open override fun <T> toObject(valueType: Class<T>, serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T
Link copied to clipboard
inline fun <T> DocumentSnapshot.toObject(): T?
inline fun <T> DocumentSnapshot.toObject(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?

The SDK's reified toObject; deprecated towards com.google.firebase.serialization.toObject.

inline fun <T> DocumentSnapshot.toObject(): T?

The document as T, as the Android SDK's reified toObject, through the serializer of T with the Android SDK's rules (FirebaseFormat.Firestore, see firestoreFormat) on every platform, @DocumentId and @ServerTimestamp included; null when the document does not exist. It takes the place of the SDK's reflective toObject(Class) and of the SDK's own reified toObject<T>() (com.google.firebase.firestore.toObject), which is deprecated with an error.

The document as T (see DocumentSnapshot.toObject); a query document always exists.

inline fun <T> DocumentSnapshot.toObject(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): T?

The document as T (see toObject), with the server timestamps resolved as serverTimestampBehavior says.

The document as T (see DocumentSnapshot.toObject), with the server timestamps resolved as serverTimestampBehavior says.

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