sequelize exclude attributes from the query code example
Example 1: sequelize exclude attribute
User
.findAll({
attributes: {exclude: ['password']},
order: [['id','DESC']]})
.then( users => {
return reply( ReplyUtil.ok(users) );
})
.catch( err => {
return reply( ReplyUtil.badImplementation(err) );
});
Example 2: sequelize attributes exclude all
attributes: []
Example 3: exclude attribute sequelize query
MyModel.findAll({
attributes: {exclude: ['some_field']}
});