added existing data imports

This commit is contained in:
Ulf Gebhardt 2019-05-29 00:20:43 +02:00
parent 014104e055
commit 4ccfe3822c
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3
7 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as category
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as category
MERGE(c:Category {id: category._id["$oid"]})
ON CREATE SET
c.name = category.title,

View File

@ -1,4 +1,4 @@
CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as json
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as json
MERGE (comment:Comment {id: json._id["$oid"]})
ON CREATE SET

View File

@ -1,4 +1,4 @@
CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as post
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as post
MERGE (p:Post {id: post._id["$oid"]})
ON CREATE SET
p.title = post.title,

View File

@ -1,4 +1,4 @@
CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as follow
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as follow
MATCH (u1:User {id: follow.userId}), (u2:User {id: follow.foreignId})
MERGE (u1)-[:FOLLOWS]->(u2)
;

View File

@ -27,21 +27,21 @@ echo "MATCH (n) DETACH DELETE n;" | "${IMPORT_CYPHERSHELL_BIN}" -u ${NEO4J_USERN
# Import Data
echo "Start Importing Data"
import_collection "badges"
#import_collection "categories"
#import_collection "comments"
#import_collection "contributions"
import_collection "categories"
import_collection "users"
import_collection "follows"
import_collection "contributions"
import_collection "shouts"
import_collection "comments"
#import_collection "emotions"
#import_collection "follows"
#import_collection "invites"
#import_collection "notifications"
#import_collection "organizations"
#import_collection "pages"
#import_collection "projects"
#import_collection "settings"
#import_collection "shouts"
#import_collection "status"
#import_collection "systemnotifications"
#import_collection "users"
#import_collection "userscandos"
#import_collection "usersettings"

View File

@ -1,4 +1,4 @@
CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as shout
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as shout
MATCH (u:User {id: shout.userId}), (p:Post {id: shout.foreignId})
MERGE (u)-[:SHOUTED]->(p)
;

View File

@ -1,4 +1,4 @@
CALL apoc.load.json('file:/tmp/mongo-export/splits/current-chunk.json') YIELD value as user
CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL}") YIELD value as user
MERGE(u:User {id: user._id["$oid"]})
ON CREATE SET
u.name = user.name,