繁体   English   中英

CypherResults py2neo获取节点对象

[英]CypherResults py2neo get node object

我需要使用py2neo获取neo4j中节点的ID。 使用以下查询,我得到包含记录对象的密码结果对象

table_query = neo4j.CypherQuery(db, "merge (x: Table{name: 'table_param'}) return x")

.data方法的内容等于以下[Record(x = Node('host / db / data / node / 31'))]

我如何获得节点对象

CypherQuery给你一个CypherResults如果你反对.execute()或一个IterableCypherResult对象,如果你.stream()它。

然后,您可以遍历结果对象:

table_query = neo4j.CypherQuery(db, "merge (x: Table{name: 'table_param'}) return x")
results = table_query.execute()

for r in results:
    # get the node you return in your query
    my_node = r[0]
    # get the properties of your node
    props = my_node.get_properties()

暂无
暂无

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

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