Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 10, 2019 15:31
Show Gist options
  • Save vladbatushkov/18f48b2a100ac9c684323732e1886728 to your computer and use it in GitHub Desktop.
Save vladbatushkov/18f48b2a100ac9c684323732e1886728 to your computer and use it in GitHub Desktop.
Cayman Airlines directions.
WITH ("https://vbatushkov.bitbucket.io/cayman.json") as url
CALL apoc.load.json(url) YIELD value
WITH value.origins AS os, value.destinationsPerOrigin as ds
UNWIND os as origin
FOREACH (d IN ds[origin] |
MERGE (a:Airport { IATA: origin })
MERGE (b:Airport { IATA: d })
MERGE (a)-[:TO]->(b)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment