【发布时间】:2020-09-30 10:55:35
【问题描述】:
我正在使用 Google Firestore 获取一些 RSS 提要。我有一个名为“Haber Listesi”的字典 当我使用 where 查询与我的 dict 进行比较时,Query 返回包含该值的整个数组。 如果有更多相等的数据,查询再次返回相同的数组。
如何只获取该数组包含的值或获取该数组一次?
for hbr in Haber_Listesi["Haber"]:
docs += db.collection('Haberler Listesi').where('Haber', 'array_contains', hbr).get()
【问题讨论】:
-
Haber_Listesi是否包含唯一值?你是什么意思:Query returns whole array that contain the value. And if there are more data which is equal, query returns same array again.?你能分享一个例子吗?可能是您必须在查询之前管理 Haber_Listesi[]。 -
是的,它具有独特的价值。我是说;例如。当我对“hbr”值运行此查询时,查询返回“hbr”所属的文档。但我只想获得“hbr”值。
标签: python google-cloud-firestore