cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Nodes not in a CSV-list

janezic
Graph Voyager

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

1 REPLY 1

ameyasoft
Graph Maven
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)})

)