Skip to content

Commit 15bd33f

Browse files
committed
add simpler snippet
1 parent 486e5c6 commit 15bd33f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

firestore-next/test.firestore.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,7 @@ describe("firestore", () => {
11591159
});
11601160

11611161
describe("aggregate queries", () => {
1162+
<<<<<<< HEAD
11621163
it("should fetch the count of documents in a collection", async () => {
11631164
const { collection, getCountFromServer } = require("firebase/firestore");
11641165
// [START count_aggregate_collection]
@@ -1177,6 +1178,24 @@ describe("firestore", () => {
11771178
console.log('count: ', snapshot.data().count);
11781179
// [END count_aggregate_query]
11791180
});
1181+
=======
1182+
it("should fetch the count of documents in a collection", async () => {
1183+
// [START count_aggregate_collection]
1184+
const coll = collection(db, "cities");
1185+
const snapshot = await getCountFromServer(coll);
1186+
console.log('count: ', snapshot.data().count);
1187+
// [END count_aggregate_collection]
1188+
});
1189+
1190+
it("should fetch the count of documents in a query", async () => {
1191+
// [START count_aggregate_query]
1192+
const coll = collection(db, "cities");
1193+
const query = query(coll, where("state", "==", "CA"));
1194+
const snapshot = await getCountFromServer(query);
1195+
console.log('count: ', snapshot.data().count);
1196+
// [END count_aggregate_query]
1197+
});
1198+
>>>>>>> 09d36f3 (add simpler snippet)
11801199
});
11811200

11821201
// TODO: Break out into separate file

0 commit comments

Comments
 (0)