Reputation: 1
In the graph database, I want to know from which route I traverse
e.g.
Path-1. a-1-2-3-4-5-b
Path-2. a-1-2-7-4-5-b
In both the above examples, it traverses from point a to point b through different routes. Here I want to identify from which route I reach to point b.
Upvotes: 0
Views: 55
Reputation: 67019
You can use the NODES
function to list the nodes in a path. There is also a RELATIONSHIPS
function for listing the relationships.
For example, if this query finds the 2 paths in your question, it will return the nodes in each path:
MATCH path = (a:A)-[*]->(b:B)
RETURN NODES(path) AS nodesInPath
Upvotes: 0