MATCH (a:accountStatistics)-[:MAX_BALANCE_ADDR]-(b) WHERE a.accountStatistics.from_addr_count > 1 AND a.accountStatistics.from_addr_count < 30 RETURN id(a) as startId,id(b) as endId LIMIT 50;
LOOKUP on accountStatistics
WHERE accountStatistics.from_addr_count > 1
AND accountStatistics.from_addr_count < 30
YIELD id(vertex) as startId | LIMIT 50 |
GO FROM $-.startId OVER MAX_BALANCE_ADDR BIDRECT
YIELD src(edge) as startId, dst(edge) as endId | LIMIT 50
最后结果需要注意双向边的问题,如果 accountStatistics 是终点,那么 endId 才是最初你的 match 查询里的 a,如果 accountStatistics 是起点就没关系了。
所以可以改成
LOOKUP on accountStatistics
WHERE accountStatistics.from_addr_count > 1
AND accountStatistics.from_addr_count < 30
YIELD id(vertex) as startId | LIMIT 50 |
GO FROM $-.startId OVER MAX_BALANCE_ADDR BIDRECT
YIELD $^ as start, $$ as end | LIMIT 50