From 3ad2c696003294d8f49fac14d2dc56e81426c3c3 Mon Sep 17 00:00:00 2001 From: jc0b Date: Tue, 9 Jun 2020 14:19:54 +0200 Subject: progress so far (for remote) --- mongodb/mongo-init-opendc-db.sh | 65 ++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 40 deletions(-) (limited to 'mongodb') 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 -- cgit v1.2.3