【发布时间】:2020-09-19 10:21:40
【问题描述】:
我有一个如下所示的 Firestore 集合,我想查询 Map 字段以过滤结果。这是我的代码,但我总是看不到结果。有人可以在这里帮忙吗?谢谢!
const myRef = firebase.firestore().collection('otherCollection').doc('123456');
const res = await firebase
.firestore()
.collection('myCollection')
.where('testMap.array1', 'in ', myRef)
.get();
【问题讨论】:
-
您是否尝试将“where”部分重写为
where("testMap.array1", "array-contains", myRef)? -
听起来像是@MedvedievV 的答案。 :)
-
@FrankvanPuffelen 我不是 JS 开发人员,也没有检查我的建议是否真的有效。如果您已经检查过,请随时发布作为答案。
标签: javascript firebase google-cloud-platform google-cloud-firestore