I have a graph containing two vertex collections: Attraction (green) and Hotel (orange).
I want to query for a certain combination of Attractions and Hotels, such as the one given below:
Attraction (start vertex) ---> Attraction ---> Hotel
|
|
v
Attraction
Graph has directed edges as shown.
The query I have now (below) gives any part of the above combination, instead of four nodes connected exactly as above.
FOR document IN Attraction FOR vertex, edge, path IN 1..2 OUTBOUND document GRAPH "LondonAttractionDB"
FILTER path.vertices[0].entityTypes[0] == "Attraction"
FILTER path.vertices[1].entityTypes[0] == "Attraction"
FILTER path.vertices[2].entityTypes[0] == "Hotel" OR path.vertices[2].entityTypes[0] == "Attraction"
RETURN path
Please see the attached image for the result generated by the above query.
Above query gives all combinations containing two, three or four nodes as shown in attached image. How can I get only the results (combinations of exactly four nodes) shown within circles?
Any help is much appreciated.
Thanks.