Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

80
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda