【发布时间】:2019-06-23 16:01:50
【问题描述】:
我在 Firestore 的集合中有一系列嵌套对象,它们的键为 UID。我想通过检查他们的 UID 是否是对象键(基本上是否存在)来查询与用户相关的所有文档。这是firestore中的模型:
这就是我目前尝试返回文件的方式:
getAllTenancyOffersByUserId() {
return this.afs.collection('collection_name', ref =>
ref.where(`application.members.${this._auth.currentUserId}`, '==', !null),
);
}
但这没有返回任何内容。我知道我可以通过该状态进行查询,但是它会不断更新,因此会导致问题
【问题讨论】:
标签: javascript angular firebase google-cloud-firestore