【问题标题】:Is there a method onChildAdded in Firestore like it is in firebase real time?Firestore 中是否有 onChildAdded 方法,就像在 firebase 中实时一样?
【发布时间】:2019-06-17 15:35:01
【问题描述】:

firestore 支持 (add document listener) 喜欢 firebase real time

firebase 实时有这样的方法

public void onChildAdded(DataSnapshot dataSnapshot, String s) {

}

但我不确定firestore中是否有这样的方法,我希望它在集合中添加新文档时通知我,我正在使用java。

【问题讨论】:

  • 添加标签以获得更多关注和改善措辞。

标签: java firebase google-cloud-firestore


【解决方案1】:

您可以在 onSnapshot 上获取新文档和更改文档的回调,如 documentation 中所述。

【讨论】:

  • 我已经检查了那个页面,但是那个页面中有很多方法,所以我不确定谁会给我我想要的。
  • 那个页面是关于 onSnapshot 的。
  • 我知道,但我看到我应该为监听器写文档名称,但我不知道文档名称是什么,因为我需要在添加新文档时通知我。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-08-13
  • 2014-02-03
  • 2017-11-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多