![](/img/trans.png)
[英]How to map an array of objects from Cloud Firestore to a List of objects in python?
[英]How to query documents containing an array of objects in Firestore with python
我有一个用户集合,其中包含一个字段,该字段是 object: {"status":"active", "children": [{"name": "jack", "id": 1234}]}
我正在尝试搜索此集合并找到 children.id 等于 1234 的用户。
我试过这个: db.collection('users').where('children', 'array_contains', {'id': 1234}).get()
db.collection('users').where('children.id', '==', 1234).get()
但没有用。
不幸的是,您不能以这种方式查询,并且此问题已在此处讨论过。 您需要修改数据结构。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.