Picture yourself, querying on a text property, looking for duplicates and BOOM you see they not only have the same text but also the same Identifier !!!
Your brain screams “OMG I have nodes with the same identifier ! How can that be !”
Your start to wonder if all the confidence you put on Neo is misplaced.
A true trial of faith.
This can happen, even though you created a fine constraint on the property, even though Neo is written by fine brains and IDs is MVP level for a DB.
You dont believe it ?
The reason it can happen is data type.
123456 and ‘123456’ are not the same.
So if you (like me) forgot to convert from string to integer in your LOAD CSV script, thats what happens.
To solve this and identify the nodes you just created, APOC can help.
What can APOC not do ?
There is a function apoc.meta.cypher.type(property) returning STRING where the property is stored as a String.
Other values are INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,MAP,LIST OF ,POINT,DATE,DATE_TIME,LOCAL_TIME,LOCAL_DATE_TIME,TIME,DURATION
WHERE apoc.meta.cypher.type(n.property) = 'STRING'
That code will give you an idea of the width of the mistake.
The Cypher code to solve this is coming next 🙂