Before we create a new customer we want to be sure to delete all possibly existing direct relationships.
How can we do that?
unwind $customers as customer
CALL apoc.cypher.runMany(
'match (c:Customer {id: $myCustomer.id})-[]->(n) detach delete n;
merge (c:Customer {id: $myCustomer.id})
set c = $myCustomer',
{myCustomer: customer})
Gives an error: Query cannot conclude with CALL (must be RETURN or an update clause)
Is there a way to first delete all direct neighbors and then merge on the customer without apoc.cypher.runMany?