Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个节点与多个节点有外部关系的情况。在到达叶节点之前,这些子节点依次可以与其他节点具有向外和向内的关系。
是否有一种编写密码查询的好方法,其中基于起始节点,我可以遍历节点子节点,然后遍历它们的相关(向内和向外)节点等等,直到我到达叶子。结果应返回找到的所有关系和节点。提前致谢。
也许这太贪心但你可以试试
START a=node(id) //replace with the id of the node you want to start MATCH p=a-[r*]->x //get all the paths to all nodes WHERE NOT(x-->()) //exclude nodes with Direction Out Relationships RETURN p,a,x,r //return whatever you need