문제

Is it possible to query, through the same AQL query, several collections effectivelly (with index speed) being some of those edge or document collections? I wanted to emulate more or less the behaviour of foreign keys on RDBMs on tables using edges.

Thanx

도움이 되었습니까?

해결책 2

If you are using document fields which are indexed by default then the behaviour is similar to foreign keys in RDBMS. For example, by default, document type collections indexes _id field and edge type collections indexes _id, _from and _to fields. AQL functions such as EDGES or NEIGHBORS are using these indexes to query relevant data.

다른 팁

I can confirm: EDGES() and NEIGHBORS() will use the automatically available indexes on the _from and/or _to attributes in the edge collections.

You may also join manually using a FILTER clause, e.g.

FOR ...
  FILTER e._from == something_else._id
  RETURN ...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top