Neo4j Cypher匹配找不到它应该的节点

时间:2018-04-27 15:58:23

标签: neo4j

添加了属性为“id”和“name”的节点

CREATE (s:subsystem {id: 12, name:"InjectEolCurrentCellSOCs"})
CREATE (s:subsystem {id: 13, name:"InjectEolCellCapacities"})
CREATE (s:subsystem {id: 14, name:"InjectEolCellResistances"})
CREATE (s:subsystem {id: 15, name:"InjectEolCellSOCs"})

此命令工作/查找节点并返回请求的值: This command works/finds the node and returns the requested value

match(n {id:13}) return (n.name);

但是这个命令找不到匹配项: But this command does not find a match.

match(n {name:"InjectEolCellCapacities"}) return (n);

这是否与“InjectEolCellCapacities”和“InjectEolCellResistances”具有相同的前13个字符有关?

1 个答案:

答案 0 :(得分:0)

如果您查看第一个图像,您将看到已保存数据“InjectEolCellCapacities”(最后有一个空格)。

因此,如果您想匹配它,您应该使用此查询:MATCH (n:subsystem { name:"InjectEolCellCapacities "}) RETURN n

您还可以搜索具有以subsystem开头的名称属性的所有InjectEolCellCapacities节点,如下所示:MATCH (n:subsystem) WHERE n.name STARTS WITH 'InjectEolCellCapacities' RETURN n