【发布时间】:2021-10-16 19:01:09
【问题描述】:
我的文档结构为:
/uploads/${USER_ID}/items/${UUID}
我可以成功监听路径末尾文档的变化,例如
firestore
.collection("uploads")
.document(configService.getUserId())
.collection("items")
.whereEqualTo("owner", configService.getUserId())
.addSnapshotListener(this::onEvent);
}
但是我怎样才能在/uploads/* 上收听所有更改,而不遍历所有附加侦听器的文档(似乎效率很低)?
我天真地尝试过
firestore
.collection("uploads")
.addSnapshotListener(this::onEvent);
}
但是,当沿路径进行更改时不会触发它。
【问题讨论】:
标签: java google-cloud-firestore firebase-admin