I have a requirements to merge the duplicate nodes and keep one copy. Issue I am facing is , when i merge nodes, there will be duplicate relationship created. Instead i wants to merge the relationship as well without duplicates.
i tried, but then the relationship is getting duplicated. i want to merge all relationship and keep one copy.
something like this , MATCH (p:People{name:"person1"}) WITH p.name as name, collect(p) as nodes, count( ) as cnt WHERE cnt > 1 WITH head(nodes) as first, tail(nodes) as rest UNWIND rest AS to_delete MATCH (to_delete)-[r:HAS_MET]->(e:name) MERGE (first)-[r1:HAS_MET]->(e) on create SET r1=r SET to_delete.isDuplicate=true RETURN count( ); [link]stackoverflow.com/questions/25315926/… . but here i know only one relationship(HAS_MET) will be consider, how do i consider all the relationship once. –