Hi, I've got a very similar question, but I am unsure on how to solve it.
I have a pretty big database (>3 000 000 nodes) and I'm trying to merge nodes but those who have multiple similar properties only.
First option works ok, but it's doing a cartesian product, and I fear of running out of memory, or that it will take ages to complete.
I want to use second option, but I don't quite understand how "WITH ... as ... COLLECT" works.
Is this query correct ?
MATCH (n:Word) WITH toLower(n.spelling) as spelling AND toLower(n.pos) as pos AND toLower(n.language) as spelling, COLLECT(n) AS ns
WHERE size(ns) > 1
CALL apoc.refactor.mergeNodes(ns) YIELD node
RETURN node;
I hope this is an appropriate place to ask my question. Thank you for ur help
Please excuse my fragile english