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