Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
on 12-07-2020 11:27 AM
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?
Have you tried adding something like:
yield result
return result
to the end of the query?