Hello, please I am working on a schema with an array of nested objects. when I want to create the User, how do I assign it.
This is my schema below:
@Schema({ timestamps: true, id: true })
export class Feedback {
@Transform(({ value }) => value.toString())
_id: ObjectId
@Prop()
label: string
@Prop({ default: false })
status: boolean
@Prop()
question: [
{
title: string
subtitle: string
types: Types
values: Values
},
]
@Prop()
comment: string
@Prop()
thankYouMessage: string
@Prop()
distributionChannels: distributionChannels
@Prop({ type: mongoose.Schema.Types.ObjectId, ref: User })
@Type(() => User)
user: User
}