Skip to content

Instantly share code, notes, and snippets.

View paulozullu's full-sized avatar
🏠
Working from home

Paulo Fabrício paulozullu

🏠
Working from home
  • Salvador, Bahia, Brazil
View GitHub Profile
@paulozullu
paulozullu / neo4j_delete_duplicate_nodes.md
Created April 12, 2019 12:37 — forked from jruts/neo4j_delete_duplicate_nodes.md
How to delete duplicate nodes and their relationships in neo4j with cypher?

How to delete duplicate nodes and their relationships in neo4j with cypher based on a property of that node?

The problem is easy to understand. We have 'duplicate' nodes in our database based on the 'id' field on the node properties.

Well this sounds easy enough, until you have to actually do it.

First step

My first attempt was to try and figure out which nodes are actualy duplicate (based on a property on the node). This seems to be pretty straightforward.

Cypher:

@Silfen
Silfen / Mongo.md
Last active December 14, 2017 19:53
Mongo

Select database

use database

Show collections

show collections

Remove