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
- Refined instructions for applying and testing schema (users/authors)
- Adjusted advanced exercise for authors with TODO methods
- Improved validate sections and log explanations
- Updated index checking instructions (mongosh / VS Code)
- General wording and pattern consistency fixes across docs
Copy file name to clipboardExpand all lines: docs/60-schema-validation/3-validate-authors.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
@@ -24,7 +24,7 @@ This is an advanced exercise that requires you to write code. If you get stuck a
24
24
<TabItemvalue="java"label="☕️ Java Spring Boot">
25
25
In this advanced exercise, you will extend the [SchemaValidationConfig](https://github.com/mongodb-developer/library-management-system/blob/java-server/java-server/src/main/java/com/mongodb/devrel/library/infrastructure/config/SchemaValidationConfig.java) class to support the authors collection.
26
26
Two methods are already defined in the class, but both are left with `// TODO` markers for you to implement:
Copy file name to clipboardExpand all lines: docs/70-indexing/1-create-compound-index.mdx
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@ In this exercise, you will build a compound index following the ESR rule, compar
8
8
9
9
## Explore the code
10
10
11
-
12
11
<TabsgroupId="server">
13
12
<TabItemvalue="node"label="🚀 NodeJS/Express">
14
13
@@ -82,17 +81,18 @@ In this exercise, you will build a compound index following the ESR rule, compar
82
81
83
82
<TabItemvalue="java"label="☕️ Java Spring Boot">
84
83
85
-
1. Let’s start with our [`java-server/src/main/java/com/mongodb/devrel/library/domain/model/IssueDetail.java`](https://github.com/mongodb-developer/library-management-system/blob/java-server/java-server/src/main/java/com/mongodb/devrel/library/domain/model/IssueDetail.java) record. Right now, it looks like this:
86
-
```
84
+
1. Let’s start with our [`IssueDetail`](https://github.com/mongodb-developer/library-management-system/blob/java-server/java-server/src/main/java/com/mongodb/devrel/library/domain/model/IssueDetail.java) record. Right now, it looks like this:
2. Now let’s optimize queries that need to filter or sort by multiple fields. For example, we often query by user._id, returnedDate, and borrowDate together.
92
+
2. Now let’s optimize queries that need to filter or sort by multiple fields.
93
+
For example, we often query by `user._id`, `returnedDate`, and `borrowDate` together.
94
94
To speed this up, we can add a compound index using the **@CompoundIndex** annotation.
@@ -119,11 +119,11 @@ In this exercise, you will build a compound index following the ESR rule, compar
119
119
auto-index-creation: true
120
120
```
121
121
122
-
This ensures that any indexes defined in your domain models (for example with @Indexed) will be created automatically by Spring Data MongoDB at startup.
122
+
This ensures that any indexes defined in your domain models (for example, with `@Indexed`) will be created automatically by Spring Data MongoDB at startup.
123
123
124
124
1. Stop the running app.
125
125
1. Locate the bottom panel and click on the `TERMINAL` tab.
126
-
1. Press Ctrl+C to interrup the running app
126
+
1. Press Ctrl+C/Cmd+c to interrupt the running app
127
127
128
128
1. Restart the app typing in the Terminal:
129
129
@@ -132,15 +132,21 @@ This ensures that any indexes defined in your domain models (for example with @I
132
132
```
133
133
As soon as the application starts, you will see log entries showing the creation of indexes, similar to the image below.
134
134
135
-
<Screenshot url="https://github.com/mongodb-developer/library-management-system" src="img/screenshots/70-indexing/index-creation.png" alt="Spring Index creation" />
135
+
<Screenshot url="https://github.com/mongodb-developer/library-management-system" src="img/screenshots/70-indexing/1-index-creation.png" alt="Spring Index creation" />
136
136
137
-
To double-check, you can either open **MongoDB Compass** and inspect the Indexes tab of the issueDetails collection,
138
-
or run the following command in mongosh:
137
+
To double-check that the index was created, you can run the following command in mongosh:
139
138
140
139
```
141
140
db.issueDetails.getIndexes()
142
141
```
143
142
143
+
:::info
144
+
Optional: If you’re using the MongoDB for VS Code extension
145
+
, you can also open the issueDetails collection in the VS Code sidebar and inspect the Indexes tab directly.
Copy file name to clipboardExpand all lines: docs/75-optimize/2-patterns.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ At this point, we also have to do additional queries to display the first five r
77
77
Let's look at the current code that is used to retrieve a single book.
78
78
Open the [`BookService`](https://github.com/mongodb-developer/library-management-system/blob/java-server/java-server/src/main/java/com/mongodb/devrel/library/domain/service/BookService.java) class and check the `getBook` method:
Copy file name to clipboardExpand all lines: docs/75-optimize/3-optimize.mdx
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,17 @@ How many calls do you need to do to your database now? Do you still need an aggr
34
34
</TabItem>
35
35
36
36
<TabItemvalue="java"label="☕️ Java Spring Boot">
37
-
Open the BookService class, and look for the getBook method. How could you simplify this code to make it blazing fast, using the patterns we just discussed?
37
+
1. Open the `BookService` class
38
+
39
+
2. locate the `getBook` method.
40
+
41
+
How could you simplify this code to make it blazing fast, using the patterns we just discussed?
0 commit comments