Result run(String query,
Map<String,Object> parameters)
Run a query and return a result stream.
This method takes a set of parameters that will be injected into the query by Neo4j. Using parameters is highly encouraged, it helps avoid dangerous cypher injection attacks and improves database performance as Neo4j can re-use query plans more often.
This version of run takes a Map of parameters. The values in the map must be values that can be converted to Neo4j types. See Values.parameters(Object...) for a list of allowed types.
Example
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("myNameParam", "Bob");
Result result = session.run( "MATCH (n) WHERE n.name = $myNameParam RETURN (n)",
parameters );
There is no error when I query by match, however, I got an error when I create a new label.