Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created January 5, 2020 14:44
Show Gist options
  • Save vladbatushkov/7fdec2c67dcb98feed5e45e183749169 to your computer and use it in GitHub Desktop.
Save vladbatushkov/7fdec2c67dcb98feed5e45e183749169 to your computer and use it in GitHub Desktop.
Flights Search Application Path
WITH { a: "Moscow", b: "New York" } as params
MATCH path = ((a:Airport { city: params.a })-[:FLIES_TO*..3]->(b:Airport { city: params.b }))
WITH nodes(path) as routes
RETURN routes, SIZE(routes) - 2 as stops
ORDER BY stops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment