現在、_key、_id、_rev、_from、_to などの内部属性にセカンダリ インデックスを作成することはできません。ArangoDB の将来のバージョンでこれを許可したいと考えていますが、これは大規模なコード変更になります。
目的の結果を得る唯一の方法は、エッジに追加の属性を作成して保存し、「_from」、「_to」、および「type」の組み合わせをそこに入れることです。これらの値は、エッジの作成時にすでにわかっているはずだと思います。
したがって、このようなエッジを保存する代わりに
db.edges.save(_from, _to, { type: type, other: ... });
次のようになります。
// create a unique index on attribute "unique"
db._collection("edges").ensureUniqueConstraint("unique");
// create a variable "unique" which contains the values of _from and _to and type
var unique = _from + "-" + _to + "-" + String(type);
// now save the edge, using the "unique" attribute
db.edges.save(_from, _to, { type: type, unique: unique, other: ... });
これは回避策ですが、その特定の問題を解決する必要があります。