Hi, yes, you're trying to do graphs with joins here. This is possible, but not very elegant and wastes the opportunity of using the advantage of a graph database.
You should give https://docs.arangodb.com/3.0/Manual/Graphs/index.html a read, and this chapter in special: https://docs.arangodb.com/3.0/Manual/Graphs/index.html#multiple-edge-collections-vs-filters-on-edge-document-attributes which will make everything more clear. Finally https://docs.arangodb.com/3.0/AQL/Graphs/Traversals.html will teach you the syntax of AQL-graph queries. If this leaves things unclear, don't hesitate to ask. Cheers, Willi On Thursday, October 6, 2016 at 7:42:03 AM UTC+2, Gregory Bleiker wrote: > > Hi all > > I'm getting started and am having a hard time getting my head around some > things. Maybe someone can help me out... > > I have two collections, 'Tags' and 'Objects', and I have an edge > collection 'tagged' > > Objects consists of 'car', 'airplane' and 'train' > Tags consists of 'land','air','public' and 'private' > (each as Arangodb documents, obviously) > > the edge collection is as follows: > public -> train > public -> airplane > private -> car > > land -> train > land -> car > air -> airplane > > The query I am trying to solve is 'Give me all landbound public objects' > > In aql I tried > > for vehicle in any 'Tags/land' tagged > for type in any 'Tags/public' tagged > filter vehicle._id == type._id > return {vehicle, type} > > But this gives me an empty collection. > > If I run this without the filter statement such as: > for vehicle in any 'Tags/land' tagged > for type in any 'Tags/public' tagged > return {vehicle, type} > > then it gives me: > 'car','train' > 'car','airplane' > > I am thinking of the for statetments as I would in a programming language, > so each inner 'for' would be executed for every element of the outer 'for'. > Is this wrong? > > Thank you for anybody taking time and reading. > > Greg > -- You received this message because you are subscribed to the Google Groups "ArangoDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
