Skip to content

Instantly share code, notes, and snippets.

@jexp
Created September 2, 2020 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jexp/1454c6f8a86533c1cd4a305484818af7 to your computer and use it in GitHub Desktop.
Save jexp/1454c6f8a86533c1cd4a305484818af7 to your computer and use it in GitHub Desktop.
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