更新时间:2023-02-14 09:28:20
您将查询名称:
var peopleRef = db.collection("users");
// there may multiple users if there are more then one `John Doe`
peopleRef.where("name", "==", "John Doe")
.get()
.then(function(querySnapshot) {
querySnapshot.forEach(function(doc) {
//Here below will list all people who's name = "John Doe", If only one then this John Doe's id no: doc.id as fallow:
console.log(doc.id, " => ", doc.data());
});
})
.catch(function(error) {
console.log("Error getting documents: ", error);
});