1User
2 .findAll({
3 attributes: {exclude: ['password']},
4 order: [['id','DESC']]})
5 .then( users => {
6 return reply( ReplyUtil.ok(users) );
7 })
8 .catch( err => {
9 return reply( ReplyUtil.badImplementation(err) );
10 });
11
1const my_model = await MyModel.findById(id, {
2 include: [
3 {
4 model: AnotherModel,
5 attributes: [ 'displayName', 'email' ] // only these attributes returned
6 },
7 { model: YetAnotherModel,
8 include: [{
9 model: AnotherModel,
10 attributes: [ 'id', 'displayName', 'email' ]
11 }]
12 }
13 ]
14})
15