MCPcopy
hub / github.com/sequelize/sequelize / decrement

Method decrement

lib/model.js:3434–3440  ·  lib/model.js::Model.decrement

* Decrement the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The decrement is done using a * ```sql SET column = column - X WHERE foo = 'bar'``` query. To get the correct value after a decrement into the Insta

(fields, options)

Source from the content-addressed store, hash-verified

3432 * @returns {Promise<Model[],?number>} returns an array of affected rows and affected count with `options.returning` true, whenever supported by dialect
3433 */
3434 static async decrement(fields, options) {
3435 return this.increment(fields, {
3436 by: 1,
3437 ...options,
3438 increment: false
3439 });
3440 }
3441
3442 static _optionsMustContainWhere(options) {
3443 assert(options && options.where, class="st">'Missing where attribute in the options parameter');

Callers 6

incrementMethod · 0.45
schema.test.jsFile · 0.45
field.test.jsFile · 0.45
decrement.test.jsFile · 0.45
decrement.test.jsFile · 0.45

Calls 1

incrementMethod · 0.95

Tested by

no test coverage detected