首页 > 解决方案 > Neo4j:Neo4j 中是否存在“不包含”?

问题描述

你知道 Neo4j 中是否存在“不包含”吗?

例如:

LOAD CSV WITH HEADERS FROM 'file:///animal.csv' as a fieldterminator "|"
match (b:Animals{animal:a.type})
where not a.type contains 'x' or not a.type contains 'abc'
set b.type=a.type

不幸的是,这样代码不起作用。

标签: neo4jcypher

解决方案


请注意,包含区分大小写 我也会在比赛前移动 WHERE,那里更便宜

LOAD CSV WITH HEADERS FROM 'file:///animal.csv' as a fieldterminator "|"
WITH a where (not (a.type contains 'x')) or (not (a.type contains 'abc'))
match (b:Animals{animal:a.type})
set b.type=a.type

你还确定你想要一个 OR 而不是 AND 吗?


推荐阅读