Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Last active August 1, 2019 18:06
Show Gist options
  • Save vladbatushkov/58a6a272b0d96121e549966897e7be8f to your computer and use it in GitHub Desktop.
Save vladbatushkov/58a6a272b0d96121e549966897e7be8f to your computer and use it in GitHub Desktop.
All men from Bangkok who called to women in Pattaya.
// How to use DISTINCT https://neo4j.com/docs/cypher-manual/current/clauses/return/#return-unique-results
MATCH (:City { name: "Bangkok" })<-[:FROM]-(p1:Person { gender: "Man" })
MATCH (p1)-[:OUT]->(:Call)<-[:IN]-(p2:Person { gender: "Woman" })-[:FROM]->(:City { name: "Pattaya" })
RETURN p1.name as fromBangkok, p2.name as toPattaya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment