summaryrefslogtreecommitdiff
path: root/mongodb/mongo-opendc-schema.sh
diff options
context:
space:
mode:
authorjc0b <j.burley@vu.nl>2020-04-23 14:59:48 +0200
committerjc0b <j.burley@vu.nl>2020-06-09 14:51:50 +0200
commit3e182d0476637fca2ee618d26aa6776f0e20b2c7 (patch)
treee556fbd633b979d7c233630d4692ed2e922d47df /mongodb/mongo-opendc-schema.sh
parent8d8486bef1b08fbc43cc100cca83fe6d8bc09f28 (diff)
Added basic mongodb framework
Diffstat (limited to 'mongodb/mongo-opendc-schema.sh')
-rw-r--r--mongodb/mongo-opendc-schema.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/mongodb/mongo-opendc-schema.sh b/mongodb/mongo-opendc-schema.sh
new file mode 100644
index 00000000..7fd9d10f
--- /dev/null
+++ b/mongodb/mongo-opendc-schema.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo 'Creating opendc db schema...'
+
+$MONGO_CMD = "mongo opendc --host localhost --port 27017 -u $OPENDC_DB_USERNAME -p $OPENDC_DB_PASSWORD --authenticationDatabase opendc"
+
+eval $MONGO_COMMAND --eval "db.createCollection('environments'); db.createCollection('rooms'); db.createCollection('datacenters');" \ No newline at end of file