mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Import shouts
This commit is contained in:
parent
932a593cfa
commit
494748c4c4
@ -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" "follows" "contributions" "comments"
|
||||
for collection in "badges" "categories" "users" "follows" "contributions" "shouts" "comments"
|
||||
do
|
||||
echo "Import ${collection}..." && cypher-shell < $SCRIPT_DIRECTORY/$collection.cql
|
||||
done
|
||||
|
||||
4
neo4j/import/shouts.cql
Normal file
4
neo4j/import/shouts.cql
Normal file
@ -0,0 +1,4 @@
|
||||
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)
|
||||
;
|
||||
@ -1,6 +1,2 @@
|
||||
|
||||
|
||||
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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user