How can i alter a node with SET
if an other node meets a certain condition?
Pseudo-code-example:
MATCH (node1{myId:123456}) // the node which should be compared
RETURN
CASE
WHEN node1.name = "foo" // if condition is fulfilled
THEN MATCH (node2{myId:654321}) SET node2.name = "bar" // the node which i want to edit)
END
I can't use MERGE
or simply MATCH (...) SET (...)
because 'evaluated node' != 'node which should be manipulated'. CASE
expressions don't seem to work either.
I've also tried approaches with the FOREACH-CASE hack, obviously without any success.
Note that my use case implies, that both nodes, which are involved, do already exist (and are unique).
Any suggestions?