Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Automattic/mongoose
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Apr 14, 2022
2 parents 134a486 + f74931e commit 20aa5e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/typescript/populate.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Parent {
name?: string
}
const ParentModel = model<Parent>('Parent', new Schema({
child: { type: 'ObjectId', ref: 'Child' },
child: { type: Schema.Types.ObjectId, ref: 'Child' },
name: String
}));

Expand Down Expand Up @@ -45,7 +45,7 @@ interface PopulatedParent {
child: Child | null;
}
const ParentModel = model<Parent>('Parent', new Schema({
child: { type: 'ObjectId', ref: 'Child' },
child: { type: Schema.Types.ObjectId, ref: 'Child' },
name: String
}));
const childSchema: Schema = new Schema({ name: String });
Expand All @@ -56,4 +56,4 @@ ParentModel.findOne({}).populate<Pick<PopulatedParent, 'child'>>('child').orFail
// Works
const t: string = doc.child.name;
});
```
```

0 comments on commit 20aa5e1

Please sign in to comment.