I have written the following piece of code:
places_ref = db_client.collection(u'places')
doc = places_ref.where (u'city_name', u'==', 'paris').get()
print(doc)
The console output is:
<generator object Query.get at 0x10d6736d8>
If I try this:
print(u'Document data: {}'.format(doc.to_dict()))
I get the following error:
AttributeError: 'generator' object has no attribute 'to_dict'
How do I convert the query result to a dictionary?