简体   繁体   English

多个文档的 Firestore 实时更新?

[英]Firestore realtime updates on several documents?

Here is a simple way to get automatic updates from the DB to an activity for instance.例如, 是一种从数据库自动更新活动的简单方法。 It refers to only one single document.它仅指一个文件。 My data are split into several documents on several collections, with no hierarchy (but it could be) Is it possible to 'watch' several document?我的数据被分成几个collections上的几个文件,没有层次结构(但它可能是) 是否可以“观看”几个文件? Thanks,谢谢,

You set up a listener on as many documents as you want.您可以根据需要在任意数量的文档上设置监听器。 Each listener will have to be established separately.每个侦听器都必须单独建立。 It cannot be done with a single call to addSnapshotListener.单次调用 addSnapshotListener 无法完成此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM