I am trying to set a unique constraint for an edge collection so that only one edge of a certain type can be created between two given nodes. The issue is that it seems I can't use _from
and _to
attributes as path attributes when creating the index. What I have tried so far:
db._collection('edges').ensureUniqueConstraint('_from', '_to', 'type');
I get the following error:
[ArangoError 10: bad parameter]
I don't want to check whether a certain edge type between two nodes exists before creating it.
Any hints?