public interface Firestore extends Service<FirestoreOptions>, AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
WriteBatch |
batch()
Gets a Firestore
WriteBatch instance that can be used to combine multiple writes. |
void |
close()
Closes the gRPC channels associated with this instance and frees up their resources.
|
CollectionReference |
collection(String path)
Gets a
CollectionReference that refers to the collection at the specified path. |
DocumentReference |
document(String path)
Gets a
DocumentReference that refers to the document at the specified path. |
com.google.api.core.ApiFuture<List<DocumentSnapshot>> |
getAll(DocumentReference... documentReferences)
Retrieves multiple documents from Firestore.
|
Iterable<CollectionReference> |
getCollections()
Fetches the root collections that are associated with this Firestore database.
|
<T> com.google.api.core.ApiFuture<T> |
runTransaction(Transaction.Function<T> updateFunction)
Executes the given updateFunction and then attempts to commit the changes applied within the
transaction.
|
<T> com.google.api.core.ApiFuture<T> |
runTransaction(Transaction.Function<T> updateFunction,
TransactionOptions transactionOptions)
Executes the given updateFunction and then attempts to commit the changes applied within the
transaction.
|
getOptions@Nonnull CollectionReference collection(@Nonnull String path)
CollectionReference that refers to the collection at the specified path.path - A slash-separated path to a collection.@Nonnull DocumentReference document(@Nonnull String path)
DocumentReference that refers to the document at the specified path.path - A slash-separated path to a document.@Nonnull Iterable<CollectionReference> getCollections()
FirestoreException - if the Iterable could not be initialized.@Nonnull <T> com.google.api.core.ApiFuture<T> runTransaction(@Nonnull Transaction.Function<T> updateFunction)
updateFunction - The function to execute within the transaction context.@Nonnull <T> com.google.api.core.ApiFuture<T> runTransaction(@Nonnull Transaction.Function<T> updateFunction, @Nonnull TransactionOptions transactionOptions)
updateFunction - The function to execute within the transaction context.@Nonnull com.google.api.core.ApiFuture<List<DocumentSnapshot>> getAll(DocumentReference... documentReferences)
documentReferences - List of Document References to fetch.@Nonnull WriteBatch batch()
WriteBatch instance that can be used to combine multiple writes.void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2018 Google. All rights reserved.