From b2720249337a7ac0a4a2c3d23f214251a727db73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Sat, 19 Jan 2019 00:01:30 +0100 Subject: [PATCH] Import comments --- neo4j/import/comments.cql | 12 ++++++++++++ neo4j/import/todo | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 neo4j/import/comments.cql diff --git a/neo4j/import/comments.cql b/neo4j/import/comments.cql new file mode 100644 index 000000000..16537b730 --- /dev/null +++ b/neo4j/import/comments.cql @@ -0,0 +1,12 @@ +CALL apoc.load.json('file:/mongo-export/comments.json') YIELD value as comment +MERGE (c:Comment {id: comment._id["$oid"]}) +ON CREATE SET +c.content = comment.content, +c.contentExcerpt = comment.contentExcerpt, +c.deleted = comment.deleted, +c.disabled = false +WITH comment +MATCH (p:Post {id: comment.contributionId}), (u:User {id: comment.userId}) +MERGE (c)-[:COMMENTS]->(p) +MERGE (u)-[:WROTE]->(c) +; diff --git a/neo4j/import/todo b/neo4j/import/todo index 2d912c5d4..0b86c8bc5 100644 --- a/neo4j/import/todo +++ b/neo4j/import/todo @@ -15,16 +15,6 @@ ON CREATE SET b.key = badge.key, -CALL apoc.load.json('file:/mongo-export/comments.json') YIELD value as comment -MERGE (c:Comment {id: comment._id["$oid"]}) -ON CREATE SET c.content = comment.content, - c.contentExcerpt = comment.contentExcerpt, - c.deleted = comment.deleted -WITH comment -MATCH (p:Post {id: comment.contributionId}), - (u:User {id: comment.userId}) -MERGE (c)-[:COMMENTS]->(p) -MERGE (u)-[:WROTE]->(c) CALL apoc.load.json('file:/mongo-export/follows.json') YIELD value as follow