mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
CALL apoc.load.json('file:/mongo-export/categories.json') YIELD value as category
|
|
MERGE(c:Category {id: category._id["$oid"]})
|
|
ON CREATE SET c.name = category.title,
|
|
c.slug = category.slug,
|
|
c.icon = category.icon
|
|
|
|
|
|
CALL apoc.load.json('file:/mongo-export/badges.json') YIELD value as badge
|
|
MERGE(b:Badge {id: badge._id["$oid"]})
|
|
ON CREATE SET b.key = badge.key,
|
|
b.type = badge.type,
|
|
b.icon = badge.image.path,
|
|
b.status = badge.status
|
|
|
|
|
|
|
|
|
|
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
|
|
MATCH (u1:User {id: follow.userId}),
|
|
(u2:User {id: follow.foreignId})
|
|
MERGE (u1)-[:FOLLOWS]->(u2)
|
|
|
|
|
|
CALL apoc.load.json('file:/mongo-export/shouts.json') YIELD value as shout
|
|
MATCH (u:User {id: shout.userId}),
|
|
(p:Post {id: shout.foreignId})
|
|
MERGE (u)-[:SHOUTED]->(p)
|