summaryrefslogtreecommitdiff
path: root/mongodb/mongo-init-opendc-db.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mongodb/mongo-init-opendc-db.sh')
-rw-r--r--mongodb/mongo-init-opendc-db.sh65
1 files changed, 25 insertions, 40 deletions
diff --git a/mongodb/mongo-init-opendc-db.sh b/mongodb/mongo-init-opendc-db.sh
index 965698e7..38a8d85d 100644
--- a/mongodb/mongo-init-opendc-db.sh
+++ b/mongodb/mongo-init-opendc-db.sh
@@ -105,43 +105,28 @@ $MONGO_CMD --eval 'db.prefabs.insertOne(
]
});'
-# $MONGO_CMD --eval 'db.createCollection("prefabs", {
-# validator: {
-# $jsonSchema: {
-# bsonType: "object",
-# required: ["name"],
-# properties: {
-# name: {
-# bsonType: "string",
-# description: "The name of the environment i.e. Production, or Compute Cluster"
-# },
-# datacenters: {
-# bsonType: "object",
-# required: ["name, location, length, width, height"],
-# properties: {
-# name: {
-# bsonType: "string",
-# description: "The name of the datacenter i.e. eu-west-1, or Science Building"
-# },
-# location: {
-# bsonType: "string",
-# description: "The location of the datacenter i.e. Frankfurt, or De Boelelaan 1105"
-# },
-# length: {
-# bsonType: "double",
-# description: "The physical length of the datacenter, in centimetres"
-# },
-# width: {
-# bsonType: "double",
-# description: "The physical width of the datacenter, in centimetres"
-# },
-# height: {
-# bsonType: "double",
-# description: "The physical height of the datacenter, in centimetres"
-# }
-# }
-# }
-# }
-# }
-# }
-# });' \ No newline at end of file
+$MONGO_CMD --eval 'db.createCollection("topologies");'
+
+$MONGO_CMD --eval 'db.createCollection("users");'
+
+$MONGO_CMD --eval 'db.users.insertOne(
+ {
+ "google_id": "23483578932789231",
+ "email": "jorgos.andreadis@gmail.com",
+ "given_name": "Jorgos",
+ "family_name": "Andreadis",
+ "authorizations": [
+ {
+ "simulation_id": 1,
+ "authorization_level": "OWN"
+ },
+ {
+ "simulation_id": 2,
+ "authorization_level": "READ"
+ },
+ {
+ "simulation_id": 3,
+ "authorization_level": "READWRITE"
+ }
+ ]
+ });' \ No newline at end of file