I have a "messy" data source that has duplicates in it, and trying to process it cleanly into Neo4j.
Imagine the following graph:
MATCH (cmk:Make)-[r:hasModel]->(cmm:Model) RETURN cmk,r,cmm
I tried using MERGE but I guess it's for node properties only. How do I ensure that I don't have the r:hasModel
relationship is present between two nodes exactly 0 or 1 times? In other words, I have created makes, and models, and when I process the relationships, sometimes I hit a duplicate and was looking for a single cypher that will create the r:hasModel
relationship only if it doesn't already exist, between two target nodes.
I tried CREATE UNIQUE
but it seems to kill my connection to Neo4j!
Thanks!