问题
I'm struggling to find a definition of how to use the set cypher command with a parameter map
Cheat sheet says use: SET n = {map}
I have tried:
START n = node(11379)
SET n = {Name: "Random Test Change"}
on my server
I get error:-
`.' expected but `=' found
What am I doing wrong?
回答1:
The map parameter could be used like this:
String query = "START n = node(11379) SET n = {map}";
Map<String, String> myMap = new HashMap<String, String>();
myMap.put("Name", "Random Test Change");
Map<String, Object> queryParameters = new HashMap<String, Object>();
queryParameters.put("map", myMap);
ExecutionEngine engine = new ExecutionEngine(graphDatabase);
executionResult = engine.execute(query, queryParameters);
来源:https://stackoverflow.com/questions/14439414/neo4j-cypher-set-statement-with-parameter-map