public final class Transaction extends UpdateBuilder<Transaction>A Transaction is passed to a Function to provide the methods to read and write data within the transaction context. See Also: Firestore#runTransaction(Function)
Methods
get(DocumentReference documentRef)
public ApiFuture<DocumentSnapshot> get(DocumentReference documentRef)Reads the document referred to by the provided DocumentReference. Holds a pessimistic lock on the returned document.
| Name | Description |
| documentRef | DocumentReference |
| Type | Description |
| ApiFuture<DocumentSnapshot> | The contents of the Document at this DocumentReference. |
get(Query query)
public ApiFuture<QuerySnapshot> get(Query query)Returns the result set from the provided query. Holds a pessimistic lock on all returned documents.
| Name | Description |
| query | Query |
| Type | Description |
| ApiFuture<QuerySnapshot> | The contents of the Document at this DocumentReference. |
getAll(DocumentReference[] documentReferences)
public ApiFuture<List<DocumentSnapshot>> getAll(DocumentReference[] documentReferences)Retrieves multiple documents from Firestore. Holds a pessimistic lock on all returned documents.
| Name | Description |
| documentReferences | DocumentReference[]List of Document References to fetch. |
| Type | Description |
| ApiFuture<List<DocumentSnapshot>> |
getAll(DocumentReference[] documentReferences, FieldMask fieldMask)
public ApiFuture<List<DocumentSnapshot>> getAll(DocumentReference[] documentReferences, FieldMask fieldMask)Retrieves multiple documents from Firestore, while optionally applying a field mask to reduce the amount of data transmitted from the backend. Holds a pessimistic lock on all returned documents.
| Name | Description |
| documentReferences | DocumentReference[]Array with Document References to fetch. |
| fieldMask | FieldMaskIf set, specifies the subset of fields to return. |
| Type | Description |
| ApiFuture<List<DocumentSnapshot>> |
hasTransactionId()
public boolean hasTransactionId()| Type | Description |
| boolean |