Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed May 2, 2022
1 parent f12b66a commit dad8da9
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,14 @@ public static void Demo11_MultipleAggregations(Firestore db) throws Exception {
}

public static void Demo12_Transaction(Firestore db) throws Exception {
db.runTransaction(txn -> {
AggregateQuery query = db
.collection("games")
.document("halo")
.collection("players")
.aggregate(count());
AggregateQuerySnapshot snapshot = txn.get(query).get();
assertEqual(snapshot.get(count()), 5_000_000);
return null;
});
db.runTransaction(
txn -> {
AggregateQuery query =
db.collection("games").document("halo").collection("players").aggregate(count());
AggregateQuerySnapshot snapshot = txn.get(query).get();
assertEqual(snapshot.get(count()), 5_000_000);
return null;
});
}

private static void assertEqual(Long num1, Long num2) {
Expand Down

0 comments on commit dad8da9

Please sign in to comment.