Python 如何使用Py2neo将参数传递给cypher查询Create语句?

Python 如何使用Py2neo将参数传递给cypher查询Create语句?,python,neo4j,cypher,py2neo,Python,Neo4j,Cypher,Py2neo,例如: cquery = """CREATE (u:User { Name: {username})""" data = graph.run(cquery, username=username) 类似于此,但是上面的查询我得到了cyphersynthax错误,有人能帮我吗?请查看文档:-这些语句的工作原理解释得非常清楚。它应该是这样的:cquery=“CREATE(u:User{Name:{username}})”和graph.run(cquery,username=“userna

例如:

cquery = """CREATE (u:User { Name: {username})"""     
data = graph.run(cquery, username=username) 

类似于此,但是上面的查询我得到了cyphersynthax错误,有人能帮我吗?

请查看文档:-这些语句的工作原理解释得非常清楚。它应该是这样的:
cquery=“CREATE(u:User{Name:{username}})”
graph.run(cquery,username=“username”)
。我认为您的
数据
也将是空的,因为首先,您在语句中不返回任何内容,其次,
run
方法不返回任何内容。非常感谢,这很有效,我留下了偏执。请看一看文档:-它很好地解释了这些语句的工作原理。它应该是这样的:
cquery=“CREATE(u:User{Name:{username}})”
graph.run(cquery,username=“username”)
。我认为您的
数据
也将是空的,因为首先,您在语句中不返回任何内容,其次,
run
方法不返回任何内容。非常感谢,这很有效,我离开了偏执。