【发布时间】:2018-03-26 15:01:35
【问题描述】:
【问题讨论】:
标签: angular typescript firebase ionic3 google-cloud-firestore
【问题讨论】:
标签: angular typescript firebase ionic3 google-cloud-firestore
希望你可以试试这个:
使用Cloud Firestore SDK。
let docRef = db.collection("following").doc("your-id");
docRef.get().then((doc)=> {
if (doc.exists) {
console.log("Document data:", doc.data());
let myData=doc.data();
let isTrue= myData.boolean-property-name;//return true or false
} else {
console.log("No such document!");
}
}).catch(function(error) {
console.log("Error getting document:", error);
});
使用 AngularFire2: Docs
注意:
阅读这篇文章:Google Cloud Firestore integration with Ionic and AngularFire
your-id - 你需要在这里传递你的doc
boolean-property-name - 这只是一个假名。您需要在此处传递您的实际属性名称。你的情况就像cug.....
【讨论】:
angularfire2吗?
angularfire2
Firestore 不再支持直接 .get,请改用 doc.ref.get()。
【讨论】: