【发布时间】:2020-07-07 08:01:55
【问题描述】:
我在如何从作为数组的字段中获取数据/值方面遇到问题。请看图片:
在图像中,我想获取来自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 值。任何对此有解决方案或至少只是一个想法的人,我需要你的帮助。
【问题讨论】:
标签: python python-3.x firebase google-cloud-firestore