Felix  Berth
Felix Berth

Reputation: 131

Multiple traverse via same edge collection in ArangoDB 2.8

Have one edge collection for Product->Model->Brand graphs

FOR m IN INBOUND "BrandModel/49798592791" BrandModelLink
   FOR p IN INBOUND m._id BrandModelLink
RETURN { model: m, product: p }

Result - empty. Its restriction forever or beta period?

Now I use selfmake combination like

FOR m IN INBOUND "BrandModel/49798592791" BrandModelLink
   FOR plink IN BrandModelLink
      FILTER plink._to == m._id
      FOR p IN Product 
         FILTER p._id == plink._from
RETURN { model: m, product: p }

Hope the first option will work in the final version.

P.S. Simplify AQL traverse its just powerful and amazing feature!

Upvotes: 2

Views: 155

Answers (1)

mchacki
mchacki

Reputation: 3267

there should be no restriction about using the same collection in multiple traverse statements, neither in beta nor after.

It seems to be an issue with the _id to continue traversing. This is a bug in beta and will be fixed for 2.8 final.

For now could you simply try to remove the _id in the second filter statement:

FOR m IN INBOUND "BrandModel/49798592791" BrandModelLink
   FOR p IN INBOUND m BrandModelLink
RETURN { model: m, product: p }

It is possible to use a complete document (vertex) as starting point for traversal as well.

Upvotes: 5

Related Questions