简体   繁体   English

Neo4j Cypher匹配找不到应有的节点

[英]Neo4j Cypher match doesn't find node that it should

Having added nodes with properties "id" and "name" 添加了具有属性“ id”和“名称”的节点

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);

Could this be related to the fact that "InjectEolCellCapacities" and "InjectEolCellResistances" have the same first 13 characters ? 这可能与“ InjectEolCellCapacities”和“ InjectEolCellResistances”具有相同的前13个字符这一事实有关吗?

If you look at your first imag, you will see that you have saved the data "InjectEolCellCapacities " (there is a space at the end). 如果查看第一个图像,您将看到已保存了数据“ InjectEolCellCapacities”(末尾有一个空格)。

So if you want to match it, yu should use this query : MATCH (n:subsystem { name:"InjectEolCellCapacities "}) RETURN n 因此,如果要匹配它,则yu应该使用以下查询: MATCH (n:subsystem { name:"InjectEolCellCapacities "}) RETURN n

You can also search all subsystem node that have a name property that starts with InjectEolCellCapacities like this : MATCH (n:subsystem) WHERE n.name STARTS WITH 'InjectEolCellCapacities' RETURN n 您还可以搜索具有以InjectEolCellCapacities开头的name属性的所有subsystem节点,如下所示: MATCH (n:subsystem) WHERE n.name STARTS WITH 'InjectEolCellCapacities' RETURN n

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM