Reputation: 23
I am new to Neo4j and I have some trouble filtering out relationships in a return statement. I created two nodes and 3 instances of the same relationship between these two nodes that differ only in the value of the properties:
create (p:person {name:'batman'})
create (p:person {name:'superman'})
match (p1:person {name:'batman'}),(p2:person{name:'superman'}) create (p1)- [h:HATES {intensity: 1}]->(p2)
match (p1:person {name:'batman'}),(p2:person{name:'superman'}) create (p1)- [h:HATES {intensity: 2}]->(p2)
match (p1:person {name:'batman'}),(p2:person{name:'superman'}) create (p1)- [h:HATES {intensity: 3}]->(p2)
When I try to visualise only one of those relationships (eg: intensity=2) with this code:
match (a: person)-[h:HATES]->(b: person) where h.intensity=2 return a,h,b
all 3 relationships are plotted:
Whereas by looking at the data only the filtered relationship is returned "a" "h" "b"
{"name":"batman"} {"intensity":2} {"name":"superman"}
Does anyone know how to plot only the corresponding relationship?
Upvotes: 2
Views: 364
Reputation: 16365
This is the default behavior of the Neo4j browser. If you are using Neo4j 3.2 go to "Browser settings" and uncheck the option "Connect result nodes".
After it the result showld be:
If you are using a older version of Neo4j you should toggle the option highlighted in the image below:
Upvotes: 5