Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何通过参数创建新节点_Python_Neo4j_Cypher_Py2neo - Fatal编程技术网

Python 如何通过参数创建新节点

Python 如何通过参数创建新节点,python,neo4j,cypher,py2neo,Python,Neo4j,Cypher,Py2neo,我想通过使用cypher查询向其传递参数来创建新节点及其属性: @app.route('/enter',methods=['post']) def enter_products(): results = graph.cypher.execute("CREATE (a:Products{"name","age"})") 您只需将映射作为参数传入,参数映射中的每个条目都可以作为查询中的{key}参数使用: @app.route('/enter',methods=['post']) de

我想通过使用cypher查询向其传递参数来创建新节点及其属性:

@app.route('/enter',methods=['post'])
def enter_products():
     results = graph.cypher.execute("CREATE (a:Products{"name","age"})") 

您只需将映射作为参数传入,参数映射中的每个条目都可以作为查询中的
{key}
参数使用:

@app.route('/enter',methods=['post'])
def enter_products():
     params = {"data": {"name":"Gokul","age":23}}
     results = graph.cypher.execute("CREATE (a:Products {data})",params) 

我更新了python的映射语法(我想)。您是否收到任何错误消息?500内部服务器错误内部服务器错误服务器遇到内部错误,无法完成您的请求。服务器过载或应用程序中存在错误