I've imported my millions of records using CREATE
for performance reasons, now I want to MERGE
the records together, and keep all the relationships intact.
Any ideas?
EDIT:
MATCH (c1:company), (c2:company)
WITH c1, c2
WHERE c1.name = c2.name
SET c1=c2
Is the type of thing I'm looking for.
If you want to merge nodes in cypher you can do something like this:
see: http://www.neo4j.org/graphgist?dropbox-14493611%2Fmerge_nodes.adoc
It doesn't work that way. There is no way to move relationships around, and no way to coalesce existing nodes. You should use MERGE from the beginning, along with constraints and indexes to aid performance.