Search code examples
memgraphdb

Is there something like apoc.refactor.mergeNodes in Memgraph?


I am looking for a way to merge duplicate nodes based on a specific property (e.g., name) and then relink the edges of these duplicate nodes to a single "unique" node. My goal is to consolidate duplicate entries and ensure that all relationships are preserved to the merged node.

In Neo4j there is apoc.refactor.mergeNodes procedure. I haven't found an equivalent functionality in Memgraph's documentation or in its utility modules.

Does anyone know if Memgraph provides a built-in utility or module for merging nodes in a similar manner to apoc.refactor.mergeNodes?


Solution

  • Memgraph has a merge.node procedure that allows more flexible way of merging nodes than Cypher.