Skip to content

Commit

Permalink
Update populate.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 authored Mar 2, 2023
1 parent fd367cc commit b7417ba
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/types/populate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,10 @@ async function gh13070() {
parent: { type: Schema.Types.ObjectId, ref: 'Parent', required: true }
});

const parent = model<IParent>('Parent', parentSchema);
const child = model<IChild>('Child', childSchema);

const doc = await parent.findOne();
await child.populate<{ child: IChild }>(doc, 'child');

const Parent = model<IParent>('Parent', parentSchema);
const Child = model<IChild>('Child', childSchema);

const doc = await Parent.findOne();
const doc2 = await Child.populate<{ child: IChild }>(doc, 'child');
const name: string = doc.child.name;
}

0 comments on commit b7417ba

Please sign in to comment.