Transaction

actual class Transaction(source)

A transaction, mirroring com.google.firebase.firestore.Transaction from the Firebase Android SDK: the writes are applied atomically when the Function returns. Reads inside a transaction (get) are synchronous on Android, the JVM and Apple platforms and are declared in the nonJs source set, as the JS SDK only reads asynchronously.

actual class Transaction(source)
expect class Transaction(source)

A transaction, mirroring com.google.firebase.firestore.Transaction from the Firebase Android SDK: the writes are applied atomically when the Function returns. Reads inside a transaction (get) are synchronous on Android, the JVM and Apple platforms and are declared in the nonJs source set, as the JS SDK only reads asynchronously.

actual class Transaction(source)
actual class Transaction(source)

Types

Link copied to clipboard
actual fun interface Function<TResult>

The body of a transaction; may throw FirebaseFirestoreException to fail it.

actual fun interface Function<TResult>

The body of a transaction; may throw FirebaseFirestoreException to fail it.

expect fun interface Function<TResult>

The body of a transaction; may throw FirebaseFirestoreException to fail it.

actual fun interface Function<TResult>

The body of a transaction; may throw FirebaseFirestoreException to fail it.

actual fun interface Function<TResult>

The body of a transaction; may throw FirebaseFirestoreException to fail it.

Properties

Link copied to clipboard
val ios: FIRTransaction

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 delete(documentRef: DocumentReference): Transaction

Deletes documentRef.

actual fun delete(documentRef: DocumentReference): Transaction

Deletes documentRef.

expect fun delete(documentRef: DocumentReference): Transaction

Deletes documentRef.

actual fun delete(documentRef: DocumentReference): Transaction

Deletes documentRef.

actual fun delete(documentRef: DocumentReference): Transaction

Deletes documentRef.

Link copied to clipboard
actual fun get(documentRef: DocumentReference): DocumentSnapshot

Reads documentRef inside the transaction. The JS SDK reads inside a transaction asynchronously, so on JS this throws UnsupportedOperationException: code that also targets JS uses the suspending io.github.corneloaie.firebase.firestore.Transaction.get instead.

actual fun get(documentRef: DocumentReference): DocumentSnapshot

Reads documentRef inside the transaction; the nonJsMain Transaction.get extension.

expect fun get(documentRef: DocumentReference): DocumentSnapshot

Reads documentRef inside the transaction. The JS SDK reads inside a transaction asynchronously, so on JS this throws UnsupportedOperationException: code that also targets JS uses the suspending io.github.corneloaie.firebase.firestore.Transaction.get instead.

actual fun get(documentRef: DocumentReference): DocumentSnapshot

Throws: the JS SDK reads inside a transaction asynchronously; use the suspending io.github.corneloaie.firebase.firestore.Transaction.get.

actual fun get(documentRef: DocumentReference): DocumentSnapshot

Throws: the JS SDK reads inside a transaction asynchronously; use the suspending io.github.corneloaie.firebase.firestore.Transaction.get.

Link copied to clipboard
actual fun set(documentRef: DocumentReference, data: Any): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any, options: SetOptions): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any, options: SetOptions): Transaction

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

expect fun set(documentRef: DocumentReference, data: Any): Transaction

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

expect fun set(documentRef: DocumentReference, data: Any, options: SetOptions): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any, options: SetOptions): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any): Transaction

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

actual fun set(documentRef: DocumentReference, data: Any, options: SetOptions): Transaction

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

Link copied to clipboard
actual fun update(documentRef: DocumentReference, data: Map<String, Any?>): Transaction

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

actual fun update(documentRef: DocumentReference, fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, field: String, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, data: Map<String, Any?>): Transaction

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

actual fun update(documentRef: DocumentReference, fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, field: String, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

expect fun update(documentRef: DocumentReference, data: Map<String, Any?>): Transaction

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

expect fun update(documentRef: DocumentReference, fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

expect fun update(documentRef: DocumentReference, field: String, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, data: Map<String, Any?>): Transaction

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

actual fun update(documentRef: DocumentReference, fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, field: String, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, data: Map<String, Any?>): Transaction

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

actual fun update(documentRef: DocumentReference, fieldPath: FieldPath, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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

actual fun update(documentRef: DocumentReference, field: String, value: Any?, vararg moreFieldsAndValues: Any?): Transaction

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