You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/210-Generate code/10-generate-app-code.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,15 @@ import Screenshot from "@site/src/components/Screenshot";
5
5
The Relational Migrator allows you to generate application code in a variety of languages, derived from your MongoDB schema definition.
6
6
While this code is not a full-blown app, it can save developers significant time compared to creating entity classes by hand.
7
7
8
+
## Generate model classes for your collections
9
+
8
10
- At the top, switch to Code Generation tab
9
11
- Under Language, select `C#` (or your preferred language)
10
12
- Under Template, select `Persistence Layer`
11
13
- Click each of the collections in the list. Notice the tabs containing entity classes and CRUD helpers for each collection or embedded object.
14
+
15
+
## Generate JSON Schema files
16
+
12
17
- Under Language, select `JSON'
13
18
- Under Template, select `Sample Documents`. Notice how you can view examples of how data in each collection will be structured.
14
19
- Under Template, select `JSON Schema (MongoDB)`. Notice how you can view and download JSON [Schema validators](https://mongodb-developer.github.io/intro-lab/docs/category/schema-validation) which could be used to enforce schema compliance.
Copy file name to clipboardExpand all lines: docs/50-create-project/50-create-new-project.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Ensure the Relational Migrator is installed and running (usually at http://127.0
12
12
<Screenshoturl="http://127.0.0.1:8278"src="img/50-image-001.png"alt="Screenshot of the connect modal" />
13
13
14
14
## Select one of the three options
15
-
- 👐 Click **Connect database** under "Connect to live database" if you are running the source database in the cloud, Docker or using your own hardware.
15
+
- 👐 Click **Connect database** under "Connect to live database" if you are running the source database in the cloud, Docker or using your own hardware. This is what we will use during an instructor-led hands-on lab.
16
16
- 🦸♂️ Click **Import .SQL file** under "Load schema from a file" if you don't have access to a source database and just want to work with the schema (you won't have any data to import though).
17
17
- 🦸♂️ Click **Create sample** under "Use a sample schema" to play around with a test schema, without any data. This does not require connecting to a real DB. We won't use this one in this Lab.
Copy file name to clipboardExpand all lines: docs/50-create-project/60-connect-database.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Enter the details for the PostgreSQL database you will be migrating from.
18
18
19
19
- It's important to click on the `SSL` tab and activate SSL (SSL mode Prefer is fine), otherwise we won't be able to connect to cloud hosted databases.
20
20
- If your instructors have configured a server for you to use, ask them for the host name, username and password.
21
-
-Database name should be "library"
21
+
-Click back on the `General` tab and enter the database name as `library`.
22
22
- Click `Test Connection` to ensure your details are correct.
23
23
- Click `Connect` to proceed to the next step.
24
24
- You can give your connection a name and a tag to make it simpler to remember later
Copy file name to clipboardExpand all lines: docs/60-project-settings.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ import Screenshot from "@site/src/components/Screenshot";
3
3
# 👐 Project Settings
4
4
5
5
6
-
- On the top left, click the settings icon.
6
+
- On the top left, next to the three dots, click the settings ⚙️ icon.
7
7
- Select single inherited primary key. This detects the primary key from the relational schema and sets them as the `_id` in MongoDB.
8
-
- Optionally, toggle Suggested Mappings on and off.
8
+
- Optionally, toggle Suggested Mappings on and off.
9
9
10
10
11
11
:::info
12
-
If we don't do this we'll have both an autogenerated `_id` field of type `ObjectId` and a `id` field copied from the relational DB.
12
+
If we don't do this we'll have both an autogenerated `_id` field of type `ObjectId` and a `id` field copied from the relational DB. Inheriting the id we copy the existing ids over to MongoDB from our relational DB.
13
13
:::
14
14
15
15
<Screenshoturl="http://127.0.0.1:8278"src="img/90-image-001.png"alt="Screenshot of the connect modal" />
0 commit comments