Let's take the example in the following site: https://console.neo4j.org/
After creating an edge with:
match (n{name:"Neo"})-->(t{name:"Trinity"}) create (t)-[:LOVES]->(n)
We get the following graph:
The following query:
match (a)-->(b)-->(c) return a,b,c
But the next query:
match (a)-->(b)<--(c) return a,b,c
Doesn't. I'd expect it to return every edge, since if a==c, then (a)-->(b)<--(c) is equivalent to "(a)-->(b)". Where do I get it wrong?
When the query (a)-->(b)-->(c)
returned (neo)-->(trinity)-->(neo)
, it matched two separate edges, one being (neo)-->(trinity)
and the other being (trinity)-->(neo)
.
However, the query (a)-->(b)<--(c)
cannot be satisfied by the graph unless you go through the edge (neo)-->(trinity)
twice.