How to combine cypher queries into a transaction in Py2neo v3

家住魔仙堡 提交于 2019-12-06 01:37:24

In py2neo v3, you can still use a Transaction, but the API has changed a bit.

In your sample code, you must now:

  • Use graph.begin instead of graph.cypher.begin.
  • Use tx.run instead of tx.append.

This pattern should work in v3:

tx=graph.begin()
tx.run(" ... Cypher statement 1 ... ", { ... })
tx.run(" ... Cypher statement 2 ... ", { ... })
tx.run(" ... Cypher statement 3 ... ", { ... })
tx.commit()
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!