Abhishek Borse
Abhishek Borse

Reputation: 1

Identify the path in Graph traversing

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

Answers (1)

cybersam
cybersam

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

Related Questions