Skip to content

Instantly share code, notes, and snippets.

@vranac
Last active August 29, 2015 14:10
Show Gist options
  • Save vranac/52f453c8194065c2236a to your computer and use it in GitHub Desktop.
Save vranac/52f453c8194065c2236a to your computer and use it in GitHub Desktop.
Neo4j relationships
CREATE INDEX ON :Airport(IataCode);
CREATE INDEX ON :Deal(OriginId);
CREATE INDEX ON :Deal(DestinationId);
MATCH (ao:Airport),(d:Deal)
WHERE d.OriginId = ao.IataCode
MERGE (ao)-[ro:ORIGIN]->(d);
MATCH (ad:Airport),(d:Deal)
WHERE d.DestinationId = ad.IataCode
MERGE (d)-[rd:DESTINATION]->(ad);
@jexp
Copy link

jexp commented Dec 6, 2014

You should be able to profile both statements in neo4j-shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment