neo4j - iterate all nodes in a path and comparing the property in adjacent nodes to output only the ones that match a certain conditions -


let's assume have path a(wt=80)->b(wt=100)->c(wt=110)->d(wt=160)->e(wt=170) want find out nodes in path has difference of wt>=20. in case should give me b , d.

you can first start node , end node of each relationship, , use "where" return end nodes of relationships end nodes satisfy difference condition, this,

match p = a-[:rel*]->e a.name?='a' endnode(last(relationships(p))) second, startnode(last(relationships(p))) first second.wt - first.wt >= 20 return second 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -