2019-01-22 12:48:06 +01:00

17 lines
587 B
Plaintext

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/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)