假设我有路径A(wt = 80) - > B(wt = 100) - > C(wt = 110) - > D(wt = 160) - > E(wt = 170) ) 我想找出此路径中具有wt> = 20的差异的所有节点。在这种情况下,它应该只给我B和D.
答案 0 :(得分:0)
您可以先获取每个关系的起始节点和结束节点,然后使用“Where”返回其末端节点满足差异条件的那些关系的末端节点,如下所示,
Match p = a-[:Rel*]->e
Where a.name?='A'
With endNode(last(relationships(p))) as second, startNode(last(relationships(p))) as first
Where second.wt - first.wt >= 20
Return second