mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Import comments
This commit is contained in:
parent
887a6d201f
commit
b272024933
12
neo4j/import/comments.cql
Normal file
12
neo4j/import/comments.cql
Normal file
@ -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)
|
||||
;
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user