I'm building a simple page where I want to render all items from FireStore documents. However, I do not understand what exactly FireStore provides. Is it a promise, object or something different?
Standard functon uses doc.data() to get the information. Can somebody explain why it happens? What exactly doc.data() does?
db.collection("cities").get().then(function(querySnapshot) {
querySnapshot.forEach(function(doc) {
// doc.data() is never undefined for query doc snapshots
console.log(doc.id, " => ", doc.data());
});
});