Neo4j 如何将参数传递给cypher查询?
如何将参数传递给cypher查询Neo4j 如何将参数传递给cypher查询?,neo4j,cypher,Neo4j,Cypher,如何将参数传递给cypher查询 match (n{})-[r]-(m) where ID(n)=? return n,r,m 下面是我实现的代码,但运气不好 session.run('match (n)-[r]-(m) where ID(n)={nodeID} return n,r,m', {nodeID : nodes}).then(function (result) 变量nodes是标识符数组?执行此查询时是否有错误?如果是,错误是什么?仅供参考,您的实现是正确的,只是您在查询中声明
match (n{})-[r]-(m) where ID(n)=? return n,r,m
下面是我实现的代码,但运气不好
session.run('match (n)-[r]-(m) where ID(n)={nodeID} return n,r,m', {nodeID :
nodes}).then(function (result)
变量
nodes
是标识符数组?执行此查询时是否有错误?如果是,错误是什么?仅供参考,您的实现是正确的,只是您在查询中声明参数的方式:{myVar}已被弃用,您应该改用$myVar。是的,我更改了方法$nodeID而不是{nodeID},但它不起作用。但是没有错误,也没有返回任何结果。但如果硬编码值工作正常,那么这一定是类型问题。。您确定节点
是整数吗?否则,您可以在查询中添加toInteger($nodeId)
?