1
votes

I have cypher query which should delete relationship between 2 nodes

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

after run I have error like

Invalid input ',': expected whitespace, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, CALL, RETURN, UNION, ';' or end of input (line 1, column 67 (offset: 66))

What is the problem? I can not fix it:(

1

1 Answers

3
votes

You need to specify the second term in your where clause with AND. Also, once you get past that you would have an error trying to return r - after all, you just deleted it :)

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