Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .devcontainer/container/commands/import.sh

This file was deleted.

13 changes: 13 additions & 0 deletions .devcontainer/create-library-user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use library

db.createUser({
user: "admin",
pwd: "mongodb",
roles: [
{ role: "userAdminAnyDatabase", db: "admin" },
{ role: "dbOwner", db: "library" },
{ role: "readWrite", db: "library" }
]
});

print("User 'admin' created in 'library' database.");
2 changes: 2 additions & 0 deletions .devcontainer/create-library-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# we create a user to be able to import data into MongoDB
mongosh .devcontainer/create-library-user.js
Binary file removed .devcontainer/data/library.tgz
Binary file not shown.
13 changes: 7 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
},
"containerEnv": {
"MONGODB_URI": "mongodb://admin:mongodb@localhost:27017/"
},
"postCreateCommand": "",
},
"postAttachCommand": "sh .devcontainer/create-library-user.sh",
"customizations": {
"codespaces": {"openFiles": []},
"codespaces": {
"openFiles": [
"README.md"
]
},
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-tools.vscode-jupyter",
"mongodb.mongodb-vscode"
]
}
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
network_mode: service:mongodb

migrator:
image: public.ecr.aws/v4d7k6c9/relational-migrator:1.13.2
image: public.ecr.aws/v4d7k6c9/relational-migrator:1.14.0
ports:
- "8080:8080"
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"mdb.presetConnections": [
{
"name": "mongodb container",
"connectionString": "mongodb://admin:mongodb@localhost:27017"
"name": "MongoDB destination container",
"connectionString": "mongodb://admin:mongodb@mongodb:27017"
}
]
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Workshop instructions

You can access the lab [here](https://mdb.link/rm-workshop)
You can access the lab instructions [here](https://mdb.link/rm-workshop)

## Database connection

Expand All @@ -11,3 +11,11 @@ This codespace runs a `mongodb-local` image, you can connect to it from the VS C
```
mongodb://admin:mongodb@mongodb:27017/
```

## Launch Relational Migrator

Open the codespace URL with port `8080` in your browser.
To import, use this MongoDB Connection string:
```
mongodb://admin:mongodb@mongodb:27017/library?authSource=admin
```