I am using Node Js, MySql (Sequelize) as my backend. In the image their are three rows against same TeacherId. I want to get the record where TeacherId, SubjectId AND CurriculumId are the SAME
as like this:
"data": [
{
"CurriculumId": 1,
"curriculum_name": "UK National Curriculum",
"SubjectId": 6,
"subject_name": "Anatomy",
"doc": [
{
"id": 18,
"name": "abc.zip",
"path": "https://www.google.com",
"size": "163 KB",
"createdAt": "2021-12-30T18:58:52.000Z"
},
{
"id": 21,
"name": "abcc.sql",
"path": "https://www.oogle.com",
"size": "1613 KB",
"createdAt": "2021-12-30T18:58:52.000Z"
},
]
},
{
"CurriculumId": 2,
"curriculum_name": "EYFS",
"SubjectId": 4,
"subject_name": "Statistics",
"doc": [
{
"id": 23,
"name": "1642770387740-file-example_PDF_1MB.pdf",
"path": "https://app.edukko.com/api/uploads/teacherDocuments/1642770387740-file-example_PDF_1MB.pdf",
"size": "1018.00 KB",
"createdAt": "2022-01-21T13:06:27.000Z"
}
]
}
]
Any help will be much appreciated. Thanks.