Skip to content

Instantly share code, notes, and snippets.

@janpauldahlke
Created December 20, 2017 16:46
Show Gist options
  • Save janpauldahlke/df46a7d17c3ca241bf805e71de782856 to your computer and use it in GitHub Desktop.
Save janpauldahlke/df46a7d17c3ca241bf805e71de782856 to your computer and use it in GitHub Desktop.
#this should be copied into schulcloud-server/backup/setup
#goto schulcloud-server/backup/setup and pyhton seed_schulcloud-server.py
import os
for filename in os.listdir(os.getcwd()):
print(len(filename.split('.')))
if len(filename.split('.')) <= 2:
string = str('mongoimport --db schulcloud --collection '+str(filename.split('.')[0])+' --drop --jsonArray '+str(filename))
print(string)
os.popen(string).read()
else:
continue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment