此查询将查找具有5个以上OUTPUT关系的(:Tx)节点。
match (t:Tx)-[r:OUTPUT]->(o) with count(r) as rc, t where rc > 5 return t
我遇到的问题是你如何返回(o)节点?我尝试过像
这样的事情match (t:Tx)-[r:OUTPUT]->(o) with count(r) as rc, t, o where rc > 10 return t, o
但是我得到0结果。
答案 0 :(得分:2)
您需要使用collect
功能:
MATCH (t:Tx)-[r:OUTPUT]->(o)
WITH t, collect(o) as os, count(r) as rc
WHERE rc > 5
RETURN t, os