Question

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

Was it helpful?

Solution 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.

OTHER TIPS

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 ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top