Skip to content

Instantly share code, notes, and snippets.

@vranac
Created December 1, 2014 09:57
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 vranac/d6aeb1eae81c65a78f59 to your computer and use it in GitHub Desktop.
Save vranac/d6aeb1eae81c65a78f59 to your computer and use it in GitHub Desktop.
CREATE CONSTRAINT ON (deal:Deal) ASSERT deal.id IS UNIQUE;
USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM "file:///Users/vranac/dev/deals/temp/deals_100k.csv" AS row
WITH row
MERGE (d:Deal {Id: row.id})
ON CREATE SET d.Id = row.id,
d.a = row.a,
d.b = row.b,
// 2014-12-05,
d.c = row.c,
// 2014-12-10
d.d = row.d,
d.e = row.e,
d.f = row.f,
d.g = row.g,
d.h = row.h
ON MATCH SET d.a = row.a,
d.b = row.b,
// 2014-12-05,
d.c = row.c,
// 2014-12-10
d.d = row.d,
d.e = row.e,
d.f = row.f,
d.g = row.g,
d.h = row.h
;
Result:
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 90000
Properties set: 980000
Labels added: 90000
41122902 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment