I have a table with several columns one of them is phonenumber. Some of rows in this column are empty (null) (a person did not give a phone as contact). I want to use CYPHER to make a node Phone in the database but skip null rows
I try
UNWIND $batch as row
WHERE NOT row.phonenumber IS NULL
MERGE (n: Phone { number: row.phonenumber })
and also
UNWIND $batch as row
CALL apoc.do.when (row.phonenumber IS NOT NULL,‘MERGE (n: Phone { number: row.phonenumber })’,{}) YIELD value RETURN value
and
UNWIND $batch as row
WITH row
WHERE NOT row.phonenumber IS NULL
CALL {
WITH row
MERGE (n: Phone { number: row.phonenumber })
}
but does not work
Any idea how to do this in Cypher or I have to first filter the empty rows with Row Filter
I don’t know if we have many Cypher experts here. Might be a good question for ChatGPT? In the very limited exposure I had to Cypher, I leaned hard on LLMs because the syntax was so specific.
Thank you for the reply. I already try ChatGPT and Bard but doesn’t work. Now I first filter out empty rows and then use Neo4j Writer with simple Cypher and works