I am using following code to define a mongodb entity.
@Schema({})
export class User extends BaseModel {
@Prop({ type: [String], required: true })
subjects: string[]; // line 1
// subjects: [string]; // line 2
}
What is the difference between line 1 and line 2 for defining a mongodb entity property?