I have class, with nested object where I need only one field required and then all other keys are undefined and unlimited with string type, how could I write it in TypeScript?
I have tried this logic:
@Schema({ _id: false })
class Translations extends mongoose.Document {
@Prop({ required: true })
en: string;
@Prop()
[key: string]: string;
}
but mongoose complains about it