This is inspired from the APOC refactorings, but implemented completely on the driver side, with the official Go driver for Neo4j.
This does not necessarily match 1:1 with APOC.
Run it at your own risk!
Import "github.com/graph-refactoring/graph-refactoring-go/pkg/refactoring"
and either call:
MergeNodes(neo4j.Transaction, refactoring.Pattern, []refactoring.PropertyMergePolicy)
MergeNodesFn(refactoring.Pattern, policies []refactoring.PropertyMergePolicy) neo4j.TransactionWork
The first is better suited for explicit driver transactions. The other is available as a transaction function.
Adapt cmd/merge-nodes-example/main.go
connection settings and run:
go run ./cmd/merge-nodes-example
This assumes the movie graph has been imported.