Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

79
Views
sequlize array not send data in the frontend

I am trying to fetch data from the database but I can't. I can't understand how to fetch data from an array of objects.

[
    {
        "id": 2,
        "folderName": "pop",
        "folderImage": "68d04dac-6947-4c3f-906b-c97b2777cbc2slide07.jpg",
        "slug": "pop-6g4",
        "folderStatus": "open",
        "mediaType": "audio",
        "createdAt": "2021-10-11T11:13:09.000Z",
        "updatedAt": "2021-10-11T11:13:09.000Z",
        "userId": 98,
        "audios": [
            {
                "aTitle": "Roi Na Je yaad Meri Aayi Ve New Number",
                "aImage": "59622f15-3b54-4d53-8ad0-5533ee4c248fslide10.jpg",
                "votes": [
                    {
                        "vottingNum": 5,
                        "totalVote": 5,
                        "voteCount": 1,
                        "failSafe": 0
                    },
                    {
                        "vottingNum": 0,
                        "totalVote": 0,
                        "voteCount": 1,
                        "failSafe": 50
                    }
                ]
            }
        ]
    }
]

folderName easily fetched but can't fetch the audios [] data and votes[] data

I am using sequelize and node js.my controller looks like that

        const folderId = req.params.id;

    try {
        const folderWiseReport = await AudioFolder.findAll({
            where: {
                id: folderId,
            },
            include: [
                {
                    model: Audio,
                    attributes: ['aTitle', 'aImage'],
                    include: [
                        {
                            model: Vote,
                            attributes: [
                                'vottingNum',
                                'totalVote',
                                'voteCount',
                                'failSafe',
                            ],
                        },
                    ],
                },
            ],
            // raw: true,
            nest: true,
        });

        return res.json(folderWiseReport);
    } catch (error) {
        console.log(error);
    }

and in the frontend look like

   {{#each folderWiseReport}}
   <td>{{this.audios.aTitle}}</td>
   <td>{{this.audios.votes.vottingNum}}</td>
{{/each}}

I need some information on how to achieve this.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!