I am using neo4j for developing my application .Suppose there are two nodes ,A and B ,having relationship with properties from A to B and vice versa.In neo4j, relationship is shown by only one arrow with both relationships mentioned on that arrow.I want that there should be two separate arrows from node A to B and vice versa mentioning their relationship properties.Is there any way to get that.![enter image description here][1]Please help me out.
1) If I understand you correctly, you want something like the following:
CREATE (a)-[:r1]->(b)-[:r2]->(a);
That creates two nodes that have relationships directed at each other. In this example, the relationships are of type r1
and r2
.
2) However, having both relationships might not be necessary, since you can always traverse a relationship in the reverse direction. For example, suppose you created just a single relationship:
CREATE (a)-[:r1]->(b);
and you wanted to find a
starting from b
, you could do this (assuming b
has the id 1
):
START b = node(1)
MATCH (a)-[:r1]->(b)
RETURN a;