mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
16 lines
519 B
SQL
16 lines
519 B
SQL
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") 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)
|
|
;
|