I have a parent collection (class) and sub collection (students) of that parent collection. 'student' collection has a field called student_id. What I need is to get all the classes for particular student_id.
I have spent much time on searching for an answer but could't find an answer. Please help me.
I have tried this one. but not working
export class ClassService {
constructor(private db: AngularFirestore) { }
loadClasses(studentId: String) {
return this.db.collection('class', ref => ref.where('students.student_id', '==', studentId)).get();
}
}
Please help. Thanks