To specify specific fields with Node Sequelize instead of *, we set the attributes
property.
For instance, we write
const list = await template.findAll({
where: {
user_id: req.params.userId,
},
attributes: ["id", "template_name"],
});
res.status(200).json(list);
to call findAll
with an object with the attributes
property set to an array of columns to select.