Created
July 14, 2015 15:57
-
-
Save sim51/9b46bed742c9fc072fb7 to your computer and use it in GitHub Desktop.
Neo4j generate node/relation with lot of property,label & relation type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
echo "CREATE CONSTRAINT ON (n:Test) ASSERT n.node IS UNIQUE;" | |
for i in {1..1000} | |
do | |
echo "create (:Test:Test$i {" | |
for j in {1..20} | |
do | |
echo "property$i$j : 'test'," | |
done | |
echo " node:'$i'});" | |
if [[ $i > 2 ]]; then | |
prec=$(($i-1)) | |
echo "MATCH (n:Test {node:'$prec'}), (m:Test {node:'$i'}) CREATE (n)-[:RELTYPE_$i]->(m);" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment