I have the following two types of node:
c:City {name: 'blah'} s:Course {title: 'whatever', city: 'New York'}
Want to create this:
(s)-[:offered_in]->(c)
I try to get all courses that are NOT tied to cities and do not create a relationship with the city (a city is created if it does not exist). However, the problem is that my data set is about 5 million nodes, and any request I make is disconnected (if I don't do it in 10k steps).
... does anyone have any advice?
EDIT:
Here is the request for the tasks that I am starting now (it needs to be done in 10 thousand pieces (out of millions), because it takes several minutes as it is. Creates a city if it does not exist):
match (j:Job) where not has(j.merged) and has(j.city) WITH j LIMIT 10000 MERGE (c:City {name: j.city}) WITH j, c MERGE (j)-[:in]->(c) SET j.merged = 1 return count(j)
(I don’t know yet how to filter out those that are already mapped correctly, so we’ll try to do this by marking it with a custom “merged” attribute that already has an index)
source share