I am trying to delete few duplicate relationships that got created under same nodes.. I mean node A Is connected to node B with relationship R two times. Hence I have to delete one relationship. To do that I have written a query like
Match p=()-[r: relationship]->()
with r.id as id, collect(r) as branches where size(branches)>1
Foreach(n IN TAIL(branches) | Delete n)
how can I optimize this query? There are millions of records to be deleted.
Any suggestions would be great for me.
I am using Neo4j version 3.5.