Robert Schäfer c50394630c Simplify maintenance-worker once again
After learning how to restore a neo4j database in kubernetes I believe
the best way to seed is to seed locally, create a backup and then
restore the backup to the kubernetes cluster.
2019-04-23 23:12:16 +02:00

15 lines
525 B
SQL

CALL apoc.load.json('file:/tmp/mongo-export/comments.json') YIELD value as json
MERGE (comment:Comment {id: json._id["$oid"]})
ON CREATE SET
comment.content = json.content,
comment.contentExcerpt = json.contentExcerpt,
comment.deleted = json.deleted,
comment.disabled = false
WITH comment, json, json.contributionId as postId
MATCH (post:Post {id: postId})
WITH comment, post, json.userId as userId
MATCH (author:User {id: userId})
MERGE (comment)-[:COMMENTS]->(post)
MERGE (author)-[:WROTE]->(comment)
;