Neo4j SET 错误 - 未定义变量
Neo4j SET error - Variable not defined
当我在 Java 中编写以下 Neo4j Cypher 查询时:
propertiesQuery = new StringBuilder();
propertiesQuery.append("MATCH (si)-[r]->(so) WHERE r.name = $rName ");
propertiesQuery.append("SET ");
String g = "None";
propertiesQuery.append("r.flow");
propertiesQuery.append("=");
propertiesQuery.append(g);
并执行 propertiesQuery 语句,它给了我以下错误:
org.neo4j.graphdb.QueryExecutionException: Variable 'None' not defined
而实际上None是字符串变量g的值。有人可以在这里解释错误吗(我已经初始化了所需的参数 - 所以这不是错误)?
Cypher 查询需要指定字符串文字。
尝试更改:
String g = "None";
至:
String g = "'None'";
当我在 Java 中编写以下 Neo4j Cypher 查询时:
propertiesQuery = new StringBuilder();
propertiesQuery.append("MATCH (si)-[r]->(so) WHERE r.name = $rName ");
propertiesQuery.append("SET ");
String g = "None";
propertiesQuery.append("r.flow");
propertiesQuery.append("=");
propertiesQuery.append(g);
并执行 propertiesQuery 语句,它给了我以下错误:
org.neo4j.graphdb.QueryExecutionException: Variable 'None' not defined
而实际上None是字符串变量g的值。有人可以在这里解释错误吗(我已经初始化了所需的参数 - 所以这不是错误)?
Cypher 查询需要指定字符串文字。
尝试更改:
String g = "None";
至:
String g = "'None'";