I have a schema that uses the @Schema to define _id and timestamp as shown below:
@Schema({
id: true,
timestamps: {
createdAt: 'createdAt',
updatedAt: 'updatedAt',
},
})
export class Account {
@Prop({
type: String,
enum: Roles,
required: true,
})
role?: string;
@Prop({
type: String,
required: false,
})
businessName?: string;
}
I want to use reference the Account id in a function but since its not explicitly defined, I am stuck on it.
await this.userService.updateAccount(
{ _id: filter._id },
{ outlet: findInvite.outlet._id }, //Property '_id' does not exist on type 'Outlet'.ts(2339)
'_id',
);
return;
}