1

I`m using Cypher query language and I need to find nodes between node A and E. (A->B->C->D->E)

Next query returns all nodes including A and E, but i need to exclude them, to have B, C, D nodes. How can I filter my query result?

MATCH p= (A:City{name: 'City1'})-[:LINKED*]->(E:City{name: "City5"}) return nodes(p)
Taja Jan
  • 942
  • 1
  • 1
  • 11

1 Answers1

0

There are a number of ways you might do this, but a simple option is to just index into the node list using:

return nodes(p)[1..-1]
Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38