Created
December 20, 2017 16:46
-
-
Save janpauldahlke/df46a7d17c3ca241bf805e71de782856 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#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