Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python CypherResults py2neo获取节点对象_Python_Neo4j_Py2neo - Fatal编程技术网

Python CypherResults py2neo获取节点对象

Python CypherResults py2neo获取节点对象,python,neo4j,py2neo,Python,Neo4j,Py2neo,我需要使用py2neo获取neo4j中节点的id。使用下面的查询,我得到一个cypher结果对象,其中包含一个record对象 table_query = neo4j.CypherQuery(db, "merge (x: Table{name: 'table_param'}) return x") .data方法的内容等于以下内容 [记录(x=Node('host/db/data/Node/31'))] 如何获取节点对象?如果您.execute()它,我将为您提供一个对象;如果您.stream

我需要使用py2neo获取neo4j中节点的id。使用下面的查询,我得到一个cypher结果对象,其中包含一个record对象

table_query = neo4j.CypherQuery(db, "merge (x: Table{name: 'table_param'}) return x")
.data方法的内容等于以下内容 [记录(x=Node('host/db/data/Node/31'))]

如何获取节点对象?如果您
.execute()
它,我将为您提供一个对象;如果您
.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()