Skip to content

Commit dad8da9

Browse files
1 parent f12b66a commit dad8da9

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

‎google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateDemo.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,14 @@ public static void Demo11_MultipleAggregations(Firestore db) throws Exception {
213213
}
214214

215215
public static void Demo12_Transaction(Firestore db) throws Exception {
216-
db.runTransaction(txn -> {
217-
AggregateQuery query = db
218-
.collection("games")
219-
.document("halo")
220-
.collection("players")
221-
.aggregate(count());
222-
AggregateQuerySnapshot snapshot = txn.get(query).get();
223-
assertEqual(snapshot.get(count()), 5_000_000);
224-
return null;
225-
});
216+
db.runTransaction(
217+
txn -> {
218+
AggregateQuery query =
219+
db.collection("games").document("halo").collection("players").aggregate(count());
220+
AggregateQuerySnapshot snapshot = txn.get(query).get();
221+
assertEqual(snapshot.get(count()), 5_000_000);
222+
return null;
223+
});
226224
}
227225

228226
private static void assertEqual(Long num1, Long num2) {

0 commit comments

Comments
 (0)