cant use dollar sign ($) in neo4j properties

自作多情 提交于 2019-12-24 06:21:26

问题


I want to run a basic query on my node/express server

var params = {
  props : {
    id : 1,
    name : "Peter"
  }
}

var query  = [
  'MERGE (p:Person{id:$props.id})',
  'RETURN n.id as id'
];

...
session.run(query, params)
        .then(function(resp){
...

but I'm getting the following error message:

{ code: 'Neo.ClientError.Statement.SyntaxError', message: 'Variable $props not defined (line 2, column 8 (offset:
28))\n"name : $props.id"\n ^' }

The docs showed me that it is possible to use the dollar sign and I couldnt find anything about this syntax versioning.


ubunut version : 16.04 neo4j version : 3.0.6 neo4j driver version : 1.1.0


回答1:


the $param syntax is only valid from Neo4j 3.1

all the versions before it was {param}



来源:https://stackoverflow.com/questions/42328186/cant-use-dollar-sign-in-neo4j-properties

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!