Python CypherResults py2neo获取节点对象
我需要使用py2neo获取neo4j中节点的id。使用下面的查询,我得到一个cypher结果对象,其中包含一个record对象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
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()