I know with options.attributes
you list the attributes that you want to select
but Is there a way to only exclude a field ?
By now I worked it out with
User
.findAll({order: [['id','DESC']]})
.then(function(users) {
users = users.filter(function(user){
delete user.dataValues.password;
return user;
});
return reply( ReplyUtil.ok(users) );
})
.catch(function(err){
return reply( ReplyUtil.badImplementation(err) );
});
BTW
I don't understand why on earth you should use user.dataValues.password
if not delete doesn't work instead of simply user.password
if I debug like this console.log('pass: ', user.password)
I can see the password.