10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2042a94 commit fcf959dCopy full SHA for fcf959d
firestore/src/main/java/com/example/firestore/snippets/ManageDataSnippets.java
@@ -345,7 +345,8 @@ public Void updateCallback(Transaction transaction) throws Exception {
345
String returnInfoFromTransaction(long population) throws Exception {
346
Map<String, Object> map = new HashMap<>();
347
map.put("population", population);
348
- db.collection("cities").document("SF").set(map);
+ // Block until transaction is complete is using transaction.get()
349
+ db.collection("cities").document("SF").set(map).get();
350
// [START fs_return_info_transaction]
351
final DocumentReference docRef = db.collection("cities").document("SF");
352
ApiFuture<String> transaction =
0 commit comments