Regex neo4j中的cypher正则表达式运算符正在给出意外行为
我用一个节点填充了一个空的NEO4J存储:Regex neo4j中的cypher正则表达式运算符正在给出意外行为,regex,neo4j,cypher,Regex,Neo4j,Cypher,我用一个节点填充了一个空的NEO4J存储: create (P: Per {Name: "Shalom"}); 询问 neo4j> match (n) return n; | (:Per {Name: "Shalom"}) | 尝试了regex,得到了最奇怪的回应: neo4j> match (n : Per) where n.Name =- ".*lom" return n; Type mismatch: expected Float or Integer but was S
create (P: Per {Name: "Shalom"});
询问
neo4j> match (n) return n;
| (:Per {Name: "Shalom"}) |
尝试了regex,得到了最奇怪的回应:
neo4j> match (n : Per) where n.Name =- ".*lom" return n;
Type mismatch: expected Float or Integer but was String (line 2, column 33 (offset: 33))
"match (n : Per) where n.Name =- ".*lom" return n;"
你知道这里出了什么问题吗?
谢谢
Shalom Elkin正则表达式运算符不是
=-
(等于负),而是=~
(等于平铺)
因此,您的查询是:
match(n:Per),其中n.Name=~“*lom”返回n
正则表达式运算符不是=-
(等号减),而是=
(等号平铺)
因此,您的查询是:match(n:Per),其中n.Name=~“*lom”返回n