Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.