Nodes not in a CSV-list

Good Morning,

I have a cdv file with a column id and I have nodes in a neo4j-DB with the property of this id. But the lists are not congruent, so how could I find

  • elements in the CSV, where the node with the respective id does not exist?
  • nodes with their id which do not exist in the CSV?

the question is not about accessing the external file, but about the formulating of the where clause in the MATCH-statement.

Thank you,

JJJ

Try this:

OPTIONAL MATCH (a:ABC) where a.id = toInteger(row.id)
WITH COALESCE(a) as a1

FOREACH(ignoreMe IN CASE WHEN a1 is null THEN [1] ELSE [] END|

	MERGE (a:ABC {id: toInteger(row.id)})

)