I have a graph containing nodes of two types: Attractions and Hotels.
What I want to do is that query for Hotels that are surrounded by three Attractions. The query I have now (below) gives Hotels that are connected to at least one Attraction.
FOR document IN Attraction
FOR vertex, edge, path IN 1..2 OUTBOUND document GRAPH "LondonAttractionDB"
FILTER path.vertices[0].entityTypes[0] == "Attraction" OR path.vertices[0].entityTypes[0] == "Attraction" OR path.vertices[0].entityTypes[0] == "Attraction"
FILTER path.vertices[1].entityTypes[0] == "Hotel"
FOR prop4 IN path.edges[0].properties
FILTER prop4.name == "name" AND prop4.value == "Food_and_beverage_location"
OR prop4.name == "name" AND prop4.value == "Food_and_beverage_location"
OR prop4.name == "name" AND prop4.value == "Accommodation_location"
RETURN DISTINCT path
This gives the following result. (Orange - Hotel, Green - Attraction)
How do I get the result shown within circles? (Hotels connected to exactly three attractions)
Any help is much appreciated.
