sequelize: fix FindOptions (#9073)

Fix FindOptions.attributes. Now allows a object having include and/or exclude properties.
http://sequelize.readthedocs.org/en/latest/api/model/#findalloptions-promisearrayinstance
This commit is contained in:
TANAKA Koichi
2016-04-23 23:36:34 +09:00
committed by Masahiro Wakame
parent ed728ac598
commit 3abab28a3e
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -882,6 +882,8 @@ User.findAll( { order : [['id', ';DELETE YOLO INJECTIONS']] } );
User.findAll( { include : [User], order : [[User, 'id', ';DELETE YOLO INJECTIONS']] } );
User.findAll( { include : [User], order : [['id', 'ASC NULLS LAST'], [User, 'id', 'DESC NULLS FIRST']] } );
User.findAll( { include : [{ model : User, where : { title : 'DoDat' }, include : [{ model : User }] }] } );
User.findAll( { attributes: ['username', 'data']});
User.findAll( { attributes: {include: ['username', 'data']} });
User.findById( 'a string' );
+1 -1
View File
@@ -3121,7 +3121,7 @@ declare module "sequelize" {
* `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to
* have in the returned instance
*/
attributes? : Array<string | [string, string]>;
attributes? : Array<string> | { include?: Array<string>, exclude?: Array<string> };
/**
* If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will