如何在NOT逻辑密码查询中删除节点本身?

时间:2014-07-20 12:05:09

标签: java neo4j cypher

我的方法中有这个代码:

"match (n:" + query.getLabel() + " {" + propertiesGenerator(query.getNodeProperties()) + "}) ,(r:" + query.getLabel() + ")" +
                    "where NOT (n)-[:" + query.getRelation() + "{" + propertiesGenerator(query.getRelationProperties()) + "}]->(r)" +
                    "return r"

它等于neo4j中的这个cypher查询:

MATCH (a:Person {name:"salar"}),(r:Person)
WHERE NOT (a)-[:PARENT_OF {age:"20"}]->(r)
RETURN r

当我执行它时,它返回“a”节点本身。换句话说,“a”与自己没有关系。我不想回归自己。我怎么能删除它?

0 个答案:

没有答案