mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Import follows
This commit is contained in:
parent
ce7ce40272
commit
932a593cfa
4
neo4j/import/follows.cql
Normal file
4
neo4j/import/follows.cql
Normal file
@ -0,0 +1,4 @@
|
||||
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)
|
||||
;
|
||||
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
echo "MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r;" | cypher-shell
|
||||
for collection in "badges" "categories" "users" "contributions" "comments"
|
||||
for collection in "badges" "categories" "users" "follows" "contributions" "comments"
|
||||
do
|
||||
echo "Import ${collection}..." && cypher-shell < $SCRIPT_DIRECTORY/$collection.cql
|
||||
done
|
||||
|
||||
@ -1,14 +1,4 @@
|
||||
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}),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user