Skip to content

Commit 4205ac5

Browse files
authored
Merge pull request #2810 from ElvannAbendroth/part4-fix
Missing code example Part4c
2 parents 6dcbcec + 0773b7c commit 4205ac5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/content/4/en/part4c.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,19 @@ notesRouter.post('/', async (request, response) => {
448448
response.json(savedNote)
449449
})
450450
```
451+
The note scheme will also need to change as follows in our models/note.js file:
452+
453+
```js
454+
const noteSchema = new mongoose.Schema({
455+
content: {
456+
type: String,
457+
minLength: 5,
458+
required: true,
459+
},
460+
important: Boolean,
461+
user: String, //highlight-line
462+
})
463+
```
451464

452465
It's worth noting that the <i>user</i> object also changes. The <i>id</i> of the note is stored in the <i>notes</i> field:
453466

0 commit comments

Comments
 (0)