Perform simple queries in Cloud Firestore  |  Firebase

PHOTO EMBED

Tue Mar 23 2021 10:54:26 GMT+0000 (UTC)

Saved by @roberth

db.collection("cities").where("capital", "==", true)
    .get()
    .then((querySnapshot) => {
        querySnapshot.forEach((doc) => {
            // doc.data() is never undefined for query doc snapshots
            console.log(doc.id, " => ", doc.data());
        });
    })
    .catch((error) => {
        console.log("Error getting documents: ", error);
    });
content_copyCOPY

https://firebase.google.com/docs/firestore/query-data/get-data