Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8455f4

Browse files
committed
add basic read snippet
1 parent af57314 commit c8455f4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

firestore-next/test.firestore.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,22 @@ describe("firestore-pipelines", () => {
13521352
db = getFirestore(app, "enterprise");
13531353
});
13541354

1355+
async function basicRead() {
1356+
const readDataPipeline = db.pipeline()
1357+
.collection("users")
1358+
1359+
// Execute the pipeline and handle the result
1360+
readDataPipeline.execute()
1361+
.then((querySnapshot) => {
1362+
querySnapshot.forEach((result) => {
1363+
console.log(`${result.id} => ${result.data()}`);
1364+
});
1365+
})
1366+
.catch((error) => {
1367+
console.error("Error getting documents: ", error);
1368+
});
1369+
}
1370+
13551371
function pipelineConcepts() {
13561372
// [START pipeline_concepts]
13571373
const pipeline = db.pipeline()

0 commit comments

Comments
 (0)