Directed Paths shown when not Directed?

Why does the returned nodes show a directed relationship when the relationship is not directed actually ?

match (p)-[:KNOWS]-(k:Person{name:"Keanu Reeves"})
return p, k
limit 5

You misunderstand here, all relationships have a direction, there is no such thing as an undirected relationship in Neo4j, and results will show the direction of the relationships returned.

When you omit the direction of a relationship when you query, you're saying that the direction of the relationship is not a factor in the pattern to match, allowing the match to apply no matter the direction of the relationship.

1 Like