在Py2neo有追加的交易,然後提交它們作爲一個塊到服務器py2neo博爾特:如何tx.append語句轉換爲BOLT
from py2neo import Graph
graph = Graph()
tx = graph.cypher.begin()
stmt1 = "CREATE (:Person {name: 'Guinevere'})"
stmt2 = "CREATE (:Person {name: 'Tom'})"
stmt3 = "CREATE (:Person {name: 'Anna'})"
tx.append(stmt)
tx.append(stmt2)
tx.append(stmt3)
tx.commit()
我似乎無法找到的能力BOLT Neo4j-driver手冊中的等效語法來使其起作用。追加不被識別。
driver = GraphDatabase.driver("bolt://localhost",
auth=basic_auth('neo4j', 'password'),
encrypted=True,
trust=TRUST_ON_FIRST_USE)
session = driver.session()
tx = session.begin_transaction()
tx.append(stmt1) --this does not work
tx.append(stmt2) --this does not work
tx.append(stmt3) --this does not work
tx.commit() --this does not work
什麼是正確的方法來做到這一點?