如何交错返回节点和关系? 使用 Matrix 电影数据库,查询语句为:
MATCH p=(a1:Actor {name:"Keanu Reeves"})-[r *0..5]-(a2:Actor {name: "Carrie-Anne Moss"})
return [n in nodes(p)|coalesce(n.title,n.name)], [rel in relationships(p)|type(rel)]
返回两列,一列是节点,另一列是关系。
Keanu Reeves, The Matrix, Laurence Fishburne, The Matrix Reloaded, Carrie-Anne Moss | ACTS_IN, ACTS_IN, ACTS_IN, ACTS_IN
...
但我希望
Keanu Reeves, ACTS_IN, The Matrix, ACTS_IN, Laurence Fishburne, ACTS_IN, The Matrix Reloaded, ACTS_IN, Carrie-Anne Moss
...