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?