ไปที่คอนโซล

Transaction

public class Transaction extends Object

A Transaction is passed to a Function to provide the methods to read and write data within the transaction context.

Subclassing Note: Cloud Firestore classes are not meant to be subclassed except for use in test mocks. Subclassing is not supported in production code and new SDK releases may break code that does so.

Nested Class Summary

interface Transaction.Function<TResult> An interface for providing code to be executed within a transaction context. 

Public Method Summary

Transaction
delete(DocumentReference documentRef)
Deletes the document referred to by the provided DocumentReference.
DocumentSnapshot
get(DocumentReference documentRef)
Reads the document referenced by this DocumentReference
Transaction
set(DocumentReference documentRef, Object data)
Overwrites the document referred to by the provided DocumentReference.
Transaction
set(DocumentReference documentRef, Object data, SetOptions options)
Writes to the document referred to by the provided DocumentReference.
Transaction
update(DocumentReference documentRef, Map<StringObject> data)
Updates fields in the document referred to by the provided DocumentReference.
Transaction
update(DocumentReference documentRef, String field, Object value, Object... moreFieldsAndValues)
Updates fields in the document referred to by the provided DocumentReference.
Transaction
update(DocumentReference documentRef, FieldPath fieldPath, Object value, Object... moreFieldsAndValues)
Updates fields in the document referred to by the provided DocumentReference.

Inherited Method Summary

Public Methods

public Transaction delete (DocumentReference documentRef)

Deletes the document referred to by the provided DocumentReference.