PatternExpressions 不允许引入新的变量

PatternExpressions are not allowed to introduce new variables

我有两种类型的关系可以存在于两个相同的节点之间。我想提取只有 type1 而没有 type2 关系的节点。我的查询是:

Match (n) where (n)-[:type1]-(m) and (not (n)-[:type2]-(m)) return n

这给出了错误:

PatternExpressions are not allowed to introduce new variables: 'm'. (line 1, column 32 (offset: 31))
"Match (n) where (n)-[:type1]-(m) and (not (n)-[:type2]-(m)) return n"
                               ^

Googling around nor the documentation Patterns - Neo4j Cypher Manual都没有给我任何有用的帮助。你知道这是为什么吗?

这个怎么样。

match(n)-[:type1]-(m)
where not (n)-[:type2]-(m)
return n