Created
September 2, 2020 10:08
-
-
Save jexp/1454c6f8a86533c1cd4a305484818af7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create constraint on (j:Job) assert j.id is unique; | |
// rows = [{id:1, name:"ddd"},{id:2,,}] | |
session.write_transaction(lambda tx: | |
tx.run(""" | |
unwind $rows as row | |
merge (j:Job {id:row.id}) on create set j.name = row.name | |
""", rows=rows) | |
) | |
call apoc.periodic.iterate( | |
"call apoc.load.json(url) yield value return value", | |
"merge (j:Job {value.id}) on create set j += value.data", | |
{batchSize:10000, parallel:true} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment