User
.findAll({
attributes: {exclude: ['password']},
order: [['id','DESC']]})
.then( users => {
return reply( ReplyUtil.ok(users) );
})
.catch( err => {
return reply( ReplyUtil.badImplementation(err) );
});
MyModel.findAll({
attributes: {exclude: ['some_field']}
});
const my_model = await MyModel.findById(id, {
include: [
{
model: AnotherModel,
attributes: [ 'displayName', 'email' ] // only these attributes returned
},
{ model: YetAnotherModel,
include: [{
model: AnotherModel,
attributes: [ 'id', 'displayName', 'email' ]
}]
}
]
})
attributes: []