thrownewsequelizeErrors.QueryError('The argument passed to findAll must be an options object, use findByPk 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');
thrownewError('The argument passed to findOne must be an options object, use findByPk 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');
}
}
...
@@ -1917,7 +1911,7 @@ class Model {
...
@@ -1917,7 +1911,7 @@ class Model {
}
}
// Bypass a possible overloaded findAll.
// Bypass a possible overloaded findAll.
returnthis.findAll(_.defaults(options,{
returnawaitthis.findAll(_.defaults(options,{
plain:true
plain:true
}));
}));
}
}
...
@@ -1938,7 +1932,7 @@ class Model {
...
@@ -1938,7 +1932,7 @@ class Model {
*
*
* @returns {Promise<DataTypes|object>} Returns the aggregate result cast to `options.dataType`, unless `options.plain` is false, in which case the complete data result is returned.
* @returns {Promise<DataTypes|object>} Returns the aggregate result cast to `options.dataType`, unless `options.plain` is false, in which case the complete data result is returned.
* @returns {Promise<boolean>} Returns a boolean indicating whether the row was created or updated. For MySQL/MariaDB, it returns `true` when inserted and `false` when updated. For Postgres/MSSQL with `options.returning` true, it returns record and created boolean with signature `<Model, created>`.
* @returns {Promise<boolean>} Returns a boolean indicating whether the row was created or updated. For MySQL/MariaDB, it returns `true` when inserted and `false` when updated. For Postgres/MSSQL with `options.returning` true, it returns record and created boolean with signature `<Model, created>`.
* @returns {Promise<Model[],?number>} returns an array of affected rows and affected count with `options.returning` true, whenever supported by dialect
* @returns {Promise<Model[],?number>} returns an array of affected rows and affected count with `options.returning` true, whenever supported by dialect
* @returns {Promise<Model[],?number>} returns an array of affected rows and affected count with `options.returning` true, whenever supported by dialect
* @returns {Promise<Model[],?number>} returns an array of affected rows and affected count with `options.returning` true, whenever supported by dialect
*/
*/
staticdecrement(fields,options){
staticasyncdecrement(fields,options){
options=_.defaults({increment:false},options,{
options=_.defaults({increment:false},options,{
by:1
by:1
});
});
returnthis.increment(fields,options);
returnawaitthis.increment(fields,options);
}
}
static_optionsMustContainWhere(options){
static_optionsMustContainWhere(options){
...
@@ -3863,7 +3797,7 @@ class Model {
...
@@ -3863,7 +3797,7 @@ class Model {
*
*
* @returns {Promise<Model>}
* @returns {Promise<Model>}
*/
*/
save(options){
asyncsave(options){
if(arguments.length>1){
if(arguments.length>1){
thrownewError('The second argument was removed in favor of the options object.');
thrownewError('The second argument was removed in favor of the options object.');
letignoreChanged=_.difference(this.changed(),options.fields);// In case of update where it's only supposed to update the passed values and the hook values
letignoreChanged=_.difference(this.changed(),options.fields);// In case of update where it's only supposed to update the passed values and the hook values