问题
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