cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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?

Comments
terryfranklin82
Graph Voyager

Have you tried adding something like:

yield result
return result

to the end of the query?

Version history
Last update:
‎12-07-2020 11:27 AM
Updated by:
Contributors