I have a graph network as shown below
What I want is to get "only" the longest path between Node 1 and Node 4. I have written the query as follows for it:
MATCH p = ((n {name: '1'})-[:Relation*..]-(n1{name: '4'}))
WITH max(length(p)) AS pathLength
MATCH p1 = ((n {name: '1'})-[:Relation*..]-(n1{name: '4'}))
WHERE length(p1) = pathLength
RETURN p1
However, the query returns all the relationships between the nodes (the image above is actually the result of the query) that are a part of the path, is there any way to avoid that?
New to Neo4j, any help would be appreciated.
Thanks

