cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

⛖ How to Create the bidirectional Relationships!?

I tried to create bidirectional relationships by using this pattern (a)-[:]-(b) and also this one (a)<-[:]->(b).
but at the end result is direct to one part of the nodes from the first parenthesis to last one (a)-[:]->(b) any suggestion?

1 ACCEPTED SOLUTION

Looks like the tutorial is just fine:

As Neo4j follows Property Graph Data Model, it should support only directional relationships. If we try to create a Relationship without any direction, then Neo4j DB server should throw an error

So you can only store directional relationships. But nothing stops you by omitting the direction of relationship when you are doing a MATCH statement.

View solution in original post

4 REPLIES 4

Neo4j cannot store bidirectional relationships. No way around this, you can however treat relationships as bidirectional when querying your graph.

Looks like the tutorial is just fine:

As Neo4j follows Property Graph Data Model, it should support only directional relationships. If we try to create a Relationship without any direction, then Neo4j DB server should throw an error

So you can only store directional relationships. But nothing stops you by omitting the direction of relationship when you are doing a MATCH statement.

I have a graph with only some edges that are bi-directional.   I am clueless to make cypher queries so that the resulting graph can I have a node with bi-directional edge