Skip to content

Commit 20aa5e1

Browse files
committed
Merge branch 'master' of github.com:Automattic/mongoose
2 parents 134a486 + f74931e commit 20aa5e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/typescript/populate.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Parent {
1111
name?: string
1212
}
1313
const ParentModel = model<Parent>('Parent', new Schema({
14-
child: { type: 'ObjectId', ref: 'Child' },
14+
child: { type: Schema.Types.ObjectId, ref: 'Child' },
1515
name: String
1616
}));
1717

@@ -45,7 +45,7 @@ interface PopulatedParent {
4545
child: Child | null;
4646
}
4747
const ParentModel = model<Parent>('Parent', new Schema({
48-
child: { type: 'ObjectId', ref: 'Child' },
48+
child: { type: Schema.Types.ObjectId, ref: 'Child' },
4949
name: String
5050
}));
5151
const childSchema: Schema = new Schema({ name: String });
@@ -56,4 +56,4 @@ ParentModel.findOne({}).populate<Pick<PopulatedParent, 'child'>>('child').orFail
5656
// Works
5757
const t: string = doc.child.name;
5858
});
59-
```
59+
```

0 commit comments

Comments
 (0)