Package-level declarations

Functions

Link copied to clipboard
inline fun <T : Any> CollectionReference.addData(data: T): <Error class: unknown class><DocumentReference>

Adds a new document with an automatically generated id and data, a map of field values or a @Serializable class mapped by the format (see CollectionReference.add).

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

inline fun <T> Query.dataObjects(metadataChanges: MetadataChanges = MetadataChanges.EXCLUDE): Flow<List<T>>

The query results as T (see toObject) and every change to them as a Flow, as the Android SDK's dataObjects.

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

inline fun <T : Any> Transaction.setData(documentRef: DocumentReference, data: T): Transaction

Writes data (see DocumentReference.setData) to documentRef in the transaction.

inline fun <T : Any> WriteBatch.setData(documentRef: DocumentReference, data: T): WriteBatch

Writes data (see DocumentReference.setData) to documentRef in the batch.

inline fun <T : Any> Transaction.setData(documentRef: DocumentReference, data: T, options: SetOptions): Transaction

Writes data (see DocumentReference.setData) to documentRef in the transaction according to options.

inline fun <T : Any> WriteBatch.setData(documentRef: DocumentReference, data: T, options: SetOptions): WriteBatch

Writes data (see DocumentReference.setData) to documentRef in the batch according to options.

Link copied to clipboard
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
inline fun <T> QuerySnapshot.toObjects(): List<T>

The documents as T (see DocumentSnapshot.toObject), as the Android SDK's reified toObjects.

inline fun <T> QuerySnapshot.toObjects(serverTimestampBehavior: DocumentSnapshot.ServerTimestampBehavior): List<T>

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

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).

Updates the fields in data (see DocumentReference.updateData) of documentRef in the transaction.

Updates the fields in data (see DocumentReference.updateData) of documentRef in the batch.