简体   繁体   English

(Py2neo)-如何在没有密码的情况下获取neo4j数据库中的end_node关系

[英](Py2neo) - How to get end_node of relationship in neo4j database without cypher

Are there any py2neo instruction to get end node of relationship, i have tried below code but it doesn't work. 是否有任何py2neo指令来获取关系的结束节点,我已经尝试过以下代码,但它不起作用。 thank you 谢谢

relmatcher = RelationshipMatcher(graph_db)
for rel in relmatcher.match(start_node=nodeid, r_type="IS_CONNECTED"):
    print("END NODE:",rel.end_node()["name"])

I usually do this way: 我通常这样做:

from py2neo import Graph
graph = Graph("http:yourhost")
for rel in graph.match(start_node=nodeid, rel_type="IS_CONNECTED"):
    print("END NODE:",rel.end_node()["name"])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM