我正在尝试使用neo4j python 驱动程序访问 neo4j 。我正在运行以下代码来获取事物 A的属性。我直接从 neo4j 的 GraphDatabase 打开驱动程序和会话,并使用session.run()执行图形查询。这些查询返回一个BoltStatementResult对象。我的问题是如何将此对象转换为我需要的实际结果(事物 A 的属性)。?
from neo4j import GraphDatabase
uri = "bolt://abc:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "password"))
def matchQuestion(tx, intent,thing):
result = tx.run("MATCH (e:thing) WHERE e.name = {thing}"
"RETURN e.description", thing=thing)
print(result)
with driver.session() as session:
session.read_transaction(matchQuestion, "define","A")