updating array in firestore error : AttributeError: ‘list’ object has no attribute ‘items’ with Python

  google-cloud-firestore, python-3.x

I am trying to update my firestore collection with a list of strings from python. My list:

results = ['link1','link2']

My Firestore document is 01
Collection in document is as follow:

links (map) —-> List_of_all_links (array)—-> this list should have 2 strings
0:link1
1:link2

SINCE i am coding using python, I added this :

db.collection(u'myjob').document(u'01').update(results)

Error: AttributeError: ‘list’ object has no attribute ‘items’

For now, I have the map and the array in my firestore but without strings. Any help ?

Source: Python-3x Questions

LEAVE A COMMENT