0
處理諾言這裏是我的代碼來檢查doc
有在collections
如何在公司的FireStore
this.shopCollection = this.afs.collection<Shop>('shops', ref => {
return ref.where('fulladdress', '==', myString)
});
我不知道爲什麼我不能用.then()
和.catch()
用這種方法。當我傳遞一個字符串來查詢,如果沒有結果發現我怎麼知道?
我使用angularfire2
版本^5.0.0-rc.1
與angular ^4.2.4
和firebase ^4.5.0
。
請幫忙。
您是否在談論使用這種方法? https://firebase.google.com/docs/reference/js/firebase.firestore.Firestore#collection –
@DougStevenson是的,因爲我使用'angularfire2',他們稱之爲'AngularFirestoreCollection'。它看起來都是一樣的。 – Hareesh
返回的AngularFirestoreCollection不是承諾。看看這些文檔,找出你可以用它做什麼,你有幾個選擇:https://github.com/angular/angularfire2/blob/master/docs/firestore/collections.md –