在密码中按关系搜索节点

时间:2016-07-06 07:30:32

标签: neo4j cypher

我想在根节点下搜索与其他节点有特定关系的所有节点。假设我有一个名为A的节点,现在我想找到节点A下具有关系R的所有节点。所以我想找到具有特定关系R的节点A的子节点或子节点。

提前致谢

更新:

For example I want to find all the nodes having relation [LIVES_IN] under the node 37 not from the root node(3).

1 个答案:

答案 0 :(得分:1)

最好通过阅读手册http://neo4j.com/docs/developer-manual/current/#cypher-query-lang并参加在线课程https://neo4j.com/graphacademy/online-training/introduction-graph-databases/

来学习Cypher。

执行此操作后,您会发现查询就像

一样简单
MATCH (a:SomeLabel {propName:"A"})<-[:PART_OF]-(b:OtherLabel)-[:LIVES_IN]->(c) RETURN c
相关问题