我在如何从数组字段中获取数据/值方面遇到了问题。请看图片:
在图中,我想从array field (parkings)
中获取parking_code
的数据/值。
我试过这个:
parking2 = db.collection(u'parking').document().get({u'parkings.parking_code'})
但是它像这样返回我:<google.cloud.firestore_v1.document.DocumentSnapshot object at 0x0000014925256550>
我也尝试过这种代码:
parking2 = db.collection(u'parking').document().get({u'parkings.parking_code'}).to_dict()
但是它返回一个None
值。任何对此有解决方案或至少有想法的人,请告诉我,我需要你的帮助
根据官方文件:
https://cloud.google.com/firestore/docs/query-data/get-data#custom_objects
相关问题 更多 >
编程相关推荐