[英]Firestore console changes does not trigger snapshotChanges subscription
I am trying to subscribe to a document in Firestore by using AngularFire. 我正在尝试使用AngularFire订阅Firestore中的文档。 When I edit my document through Firestore console, I cannot see any difference in the pulled data even after refreshing my local.
当我通过Firestore控制台编辑文档时,即使刷新本地后,在拉出的数据中也看不到任何差异。 DocumentChangeAction.type is still "added" after modification.
修改后,仍将“添加” DocumentChangeAction.type。
Doesn't console changes suppose to trigger "modified" action even for manual updates ? 控制台更改是否假设即使是手动更新也触发“已修改”操作?
Thanks. 谢谢。
retrieveUserPosts666 (uid: string, page, lastKey,now:number, nowBefore30:number) {
let plizt = [];
return this.afs.collection<any>("uk", ref => {
let query : firebase.firestore.CollectionReference | firebase.firestore.Query = ref;
query = query.where('uid','==',uid);
query = query.orderBy('postdate','desc');
query = query.startAt(lastKey).limit(page);
return query;
}).snapshotChanges().map(x=> {
x.forEach((post, index) => {
plizt.push({
"key": post.payload.doc.id,
"itm": post.payload.doc.data(),
"city" : this.retrieveBeatifulCityName(post.payload.doc.get('city')),
"cut_en" : post.payload.doc.get('description_en').substring(0,100) + "..."
})
});
return plizt;
})
}
I replaced "AngularFirestoreModule.enablePersistence()" with just "AngularFirestoreModule" in imports section of app.module.ts. 我在app.module.ts的imports部分中仅用“ AngularFirestoreModule”替换了“ AngularFirestoreModule.enablePersistence()”。 Resolved now.
现在解决。 Please refer to following page.
请参考下一页。 ( https://firebase.google.com/docs/firestore/manage-data/enable-offline )
( https://firebase.google.com/docs/firestore/manage-data/enable-offline )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.