1
を取得、私はドキュメントFIRESTOREイオン+ Firestore - bolleanフィールドが
のブールの値を取得する必要がどのように行うのか、誰を知っているのですか?Cloud Firestore SDK
を使用して
:
を取得、私はドキュメントFIRESTOREイオン+ Firestore - bolleanフィールドが
のブールの値を取得する必要がどのように行うのか、誰を知っているのですか?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.....
こんにちは、ありがとうございました...私は指示されたコードを試しましたが、それは3つのエラーを返しましたが、印刷はリンクにあります:(https://drive.google。 com/open?id = 0B14jg18TLF3USC1xc292S3FYR0k) –
アップデートを参照してください。 。 プロパティ「GET」タイプに存在しませんが、「<{}>をAngularFirestoreDocument」活字エラー ** – Sampath
は、私は1つのだけエラーが出る今変更をしましたか? –