I have this Sequelize Model named Recipe where I need to make a join from Model Diet, but I get an array of objects with only the property I want, but I would like to get it as a string, not an object.
const dbDataTest = await Recipe.findAll({
include: [
{
model: Diet,
attributes: {
exclude: ['createdAt', 'updatedAt', 'id']
},
through: {attributes: []}
},
],
});
That's why I'm excluding 3 other attributes so I can get only this output:
{
Recipe name: 'Name',
diets: ['diet one', 'diet two']
}
instead, I'm Getting:
{
Recipe name: 'Name',
diets:[
{name: 'diet one'},
{name: 'diet two'}
]
}