I'm working on adding keywords to a collection of documents (company information records).
The keyword generation works perfectly but now I'm struggling to figure out why my update isn't working.
with open (file) as csv_file:
csv_reader=csv.DictReader(csv_file,delimiter=',')
line_count=0
for row in csv_reader:
uuid=row['uuid']
name=row['name'].lower()
keywords = ""
arrName = []
for c in name:
keywords += c
arrName.append(keywords)
print(uuid, arrName)
data = {
u'keywords': arrName}
doc_ref = store.collection("org_test").where("uuid", "==", uuid).update(data)
I know it's the last line but I get the same error if I use .update or .set.
uuid is: e1393508-30ea-8a36-3f96-dd3226033abd keywords are: ['w', 'we', 'wet', 'wetp', 'wetpa', 'wetpai', 'wetpain', 'wetpaint']
Traceback (most recent call last):
File "keywords.py", line 107, in <module>
doc_ref = store.collection("org_test").where("uuid", "==", uuid).update(data)
AttributeError: 'Query' object has no attribute 'update'
I've also tried:
doc_ref = store.collection("org_test").where("uuid", "==", uuid).document.update(data)
But I get a similar error.