Closed borakrc closed 7 years ago
if possible to query with "orderByChild: 'relatedStudents.studentUserId', equalTo: true", I will implement db structure as below:
/gallery/albums = [homework, study, etc] /gallery/images = { imageId = { imgUrl: string album: albumId taggedStudents = { studentUserId1 = true, studentUserId2 = true } } }
otherwise, we might need to use another collection to link photos to multiple students. example, /student-photos/ = [list of image ids] or /students//images = [imageIds]
if possible to query with "orderByChild: 'relatedStudents.studentUserId', equalTo: true", I will implement db structure as below:
/gallery/albums = [homework, study, etc] /gallery/images = { imageId = { imgUrl: string album: albumId taggedStudents = { studentUserId1 = true, studentUserId2 = true } } }
otherwise, we might need to use another collection to link photos to multiple students. example, /student-photos/ = [list of image ids] or /students//images = [imageIds]