Skip to content

Instantly share code, notes, and snippets.

@sim51
Created July 14, 2015 15:57
Show Gist options
  • Save sim51/9b46bed742c9fc072fb7 to your computer and use it in GitHub Desktop.
Save sim51/9b46bed742c9fc072fb7 to your computer and use it in GitHub Desktop.
Neo4j generate node/relation with lot of property,label & relation type
#!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