def insert_a_document(collection_name, bean):
db = get_db()
collection = get_collection(db, collection_name)
doc = collection.createDocument()
for key in bean.keys():
if key == "id":
doc["_key"] = bean.get(key)
else:
doc[key] = bean.get(key)
doc.save()
when use python ThreadPoolExecutor to run this mutiple thread saving by calling this insert_a_document, not all documents saved but some. It's strange, do you know why, how to solve it. Thanks.
Below is my code:
def insert_a_document(collection_name, bean): db = get_db() collection = get_collection(db, collection_name) doc = collection.createDocument() for key in bean.keys(): if key == "id": doc["_key"] = bean.get(key) else: doc[key] = bean.get(key) doc.save()
when use python ThreadPoolExecutor to run this mutiple thread saving by calling this insert_a_document, not all documents saved but some. It's strange, do you know why, how to solve it. Thanks.
ArangoDB version: v3.4.0 distribute Python: v3.5