I use neo4j-rest-binding API to develop, but I face a problem when using parameters of RestCypherQueryEngine.
QueryResult<Map<String,Object>> result = engine.query("MATCH (n:{label}) RETURN n", MapUtil.map("label", label));
label is the parameter I assign in the map structure, but it has an error:
org.neo4j.rest.graphdb.RestResultException: Invalid input '{': expected whitespace or an identifier (line 1, column 10)
"MATCH (n:{label}) RETURN n"
^ at
SyntaxException
org.neo4j.cypher.internal.compiler.v2_0.parser.CypherParser$$anonfun$parse$1.apply(CypherParser.scala:51)
org.neo4j.cypher.internal.compiler.v2_0.parser.CypherParser$$anonfun$parse$1.apply(CypherParser.scala:41)
...
I can use another method to solve this problem:
QueryResult<Map<String,Object>> result = engine.query("MATCH (n:" + label +") RETURN n", null);
But I think the above method is not appropriate when I want to pass multiple parameters.