Neo4j:删除2个节点之间的关系Neo.ClientError.Statement.SyntaxError

时间:2016-09-05 13:27:20

标签: java graph neo4j cypher

我有cypher查询,它应该删除2个节点之间的关系

MATCH (t:User) - [r:LINKED_TO] - (p:Movie) 
WHERE ID (t) = {0}, ID (p) = {5} 
DELETE r 
RETURN r, t

运行后我有像

这样的错误
  

无效的输入',':预期的空白,'。',节点标签,' ['," =〜&#34 ;,IN,STARTS,ENDS,CONTAINS,IS,' ^',' *',' /','%&#39 ;,' +',' - ',' =',"<>","! =",'<&#;;'>',"< =","> =&#34 ;,AND,XOR,OR,LOAD CSV,START,MATCH,UNWIND,MERGE,CREATE,SET,DELETE,REMOVE,FOREACH,WITH,CALL,RETURN,UNION,&#39 ;;'或输入结束(第1行,第67栏(偏移:66))

有什么问题?我无法解决它:(

1 个答案:

答案 0 :(得分:2)

您需要在AND的where子句中指定第二个术语。此外,一旦你过去,你会在尝试返回r时出错 - 毕竟,你刚刚将其删除了:)

MATCH (t:User) - [r:LINKED_TO] - (p:Movie) 
WHERE ID (t) = {0}
AND ID (p) = {5} 
DELETE r 
RETURN t,p