Skip to content

Instantly share code, notes, and snippets.

@mattdeboard
Created June 21, 2014 18:55
Show Gist options
  • Select an option

  • Save mattdeboard/92b3bf4aa45530355442 to your computer and use it in GitHub Desktop.

Select an option

Save mattdeboard/92b3bf4aa45530355442 to your computer and use it in GitHub Desktop.
match (c1:City), (c2:City), p = (c1)-[r*..6]-(c2)
where c2.name = "New York" and c1.name = "Dallas" and
length([x in nodes(p) where x.name in ["Little Rock", "Saint Louis", "Pittsburgh", "Duluth", "Kansas City", c1.name, c2.name]]) = length(nodes(p))
return distinct p;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment