How to get all nodes connected to one node in neo4j graph in py2neo
问题 I want to pick a node and get all of the nodes that are connected to it by relationship. Even this they are nth degree connections. What is the py2neo or simply cypher query for this? 回答1: This Cypher query should work (if the picked node has a myId value of 123 ): MATCH p=(n { myId:123 })-[*]-() UNWIND FILTER(x IN NODES(p) WHERE x <> n) AS node RETURN DISTINCT node; The FILTER function filters out the picked node, even if there are paths that cycle back to it. 来源: https://stackoverflow.com