Having trouble using the new Firestore system.
I'm trying to retrieve a Collection of all users and go through it, but I can't seem to make it work.
db.collection("users").get().then(function(querySnapshot){
console.log(querySnapshot.data());
});
An error message pops up:
querySnapshot.data is not a function
Also, when running this code snippet:
callFireBase(mobileToCheck){
db.collection("users").where("mobile_no", '==', mobileToCheck).get().then(function(querySnapshot){
if (querySnapshot.exists) {
var userData = querySnapshot.data();
var userId = querySnapshot.id;
console.log(mobileToCheck + "Exist In DB");
}else{
console.log(mobileToCheck + "Do Not Exist In DB");
}
});
}
It consistently shows:
923052273575 Do Not Exist In DB
Even if the data exists. It's quite frustrating. You can refer to the image for more details in the docs.