thrownewsequelizeErrors.QueryError('The argument passed to findAll must be an options object, use findById if you wish to pass a single primary key value');
thrownewsequelizeErrors.QueryError('The argument passed to findAll must be an options object, use findByPk if you wish to pass a single primary key value');
}
}
if(options!==undefined&&options.attributes){
if(options!==undefined&&options.attributes){
...
@@ -1697,8 +1697,6 @@ class Model {
...
@@ -1697,8 +1697,6 @@ class Model {
/**
/**
* Search for a single instance by its primary key.
* Search for a single instance by its primary key.
*
*
* __Alias__: _findByPrimary_
*
* @param {Number|String|Buffer} id The value of the desired instance's primary key.
* @param {Number|String|Buffer} id The value of the desired instance's primary key.
* @param {Object} [options]
* @param {Object} [options]
* @param {Transaction} [options.transaction] Transaction to run query under
* @param {Transaction} [options.transaction] Transaction to run query under
...
@@ -1707,7 +1705,7 @@ class Model {
...
@@ -1707,7 +1705,7 @@ class Model {
* @see {@link Model.findAll} for a full explanation of options
* @see {@link Model.findAll} for a full explanation of options
* @return {Promise<Model>}
* @return {Promise<Model>}
*/
*/
staticfindById(param,options){
staticfindByPk(param,options){
// return Promise resolved with null if no arguments are passed
// return Promise resolved with null if no arguments are passed
if([null,undefined].indexOf(param)!==-1){
if([null,undefined].indexOf(param)!==-1){
returnPromise.resolve(null);
returnPromise.resolve(null);
...
@@ -1719,7 +1717,7 @@ class Model {
...
@@ -1719,7 +1717,7 @@ class Model {
options.where={};
options.where={};
options.where[this.primaryKeyAttribute]=param;
options.where[this.primaryKeyAttribute]=param;
}else{
}else{
thrownewError('Argument passed to findById is invalid: '+param);
thrownewError('Argument passed to findByPk is invalid: '+param);
thrownewError('The argument passed to findOne must be an options object, use findById if you wish to pass a single primary key value');
thrownewError('The argument passed to findOne must be an options object, use findByPk if you wish to pass a single primary key value');
}
}
options=Utils.cloneDeep(options);
options=Utils.cloneDeep(options);
...
@@ -1891,16 +1889,14 @@ class Model {
...
@@ -1891,16 +1889,14 @@ class Model {
* ```
* ```
* Because the include for `Profile` has `required` set it will result in an inner join, and only the users who have a profile will be counted. If we remove `required` from the include, both users with and without profiles will be counted
* Because the include for `Profile` has `required` set it will result in an inner join, and only the users who have a profile will be counted. If we remove `required` from the include, both users with and without profiles will be counted
*
*
* __Alias__: _findAndCountAll_
*
* @param {Object} [findOptions] See findAll
* @param {Object} [findOptions] See findAll
*
*
* @see {@link Model.findAll} for a specification of find and query options
* @see {@link Model.findAll} for a specification of find and query options