Skip to content

Commit fdb0a23

Browse files
authored
Updated part4c.md to alter possibly misleading noteSchema changes.
1 parent 36542d8 commit fdb0a23

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/content/4/en/part4c.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,16 @@ The note scheme will also need to change as follows in our models/note.js file:
442442
const noteSchema = new mongoose.Schema({
443443
content: {
444444
type: String,
445-
minLength: 5,
446445
required: true,
446+
minlength: 5
447447
},
448448
important: Boolean,
449-
user: String, //highlight-line
449+
// highlight-start
450+
user: {
451+
type: mongoose.Schema.Types.ObjectId,
452+
ref: 'User'
453+
}
454+
//highlight-end
450455
})
451456
```
452457

0 commit comments

Comments
 (0)