I have a schema this way.
username: { type: String, required: true, index: { unique: true } },
password: { type: String, required: true },
email : { type: String},
countryname : { type: String},
country_id : Schema.Types.ObjectId,
children: [
id: Schema.Types.ObjectId,
child_name: String,
grade_id: Schema.Types.ObjectId,
grade : { type: String },
total_gold: { type: Number},
total_diamonds:{ type: Number},
total_hearts: { type: Number},
subjects: []
]
How can i access subjects array which is internally stored in children array using mongoose?