I am using pyArango to create edges between two documents using the function
Graph.createEdge()
The problem I am facing is that ArangoDB allows to create duplicate edges with the same _to, _from pair. How to avoid this situation in ArangoDB
An easy solution is to check before insertion using fetchFirstExample() on the edges collection:
try :
edge = myEdgesCollection.fetchFirstExample({"_to": doc2._id, "_from": doc1._id})[0]
except :
edge = myGraph("myEdgesCollection", doc1, doc2, {})