不要怂,就是干,撸起袖子干!

Commit b10a8ffd by Jan Aagaard Meier

[ci skip] Add a proper to string method and clarify the return type for bulk update

1 parent f4ab84c9
Showing with 11 additions and 2 deletions
......@@ -135,6 +135,10 @@ module.exports = (function() {
}
});
Instance.prototype.toString = function () {
return '[object SequelizeInstance]';
};
/**
* Get the value of the underlying data value
*
......
......@@ -158,6 +158,10 @@ module.exports = (function() {
}
})();
Model.prototype.toString = function () {
return '[object SequelizeModel]';
};
Model.prototype.init = function(modelManager) {
var self = this;
......@@ -1338,7 +1342,8 @@ module.exports = (function() {
};
/**
* Update multiple instances that match the where options.
* Update multiple instances that match the where options. The promise returns an array with one or two elements. The first element is always the number
* of affected rows, while the second element is the actual affected rows (only supported in postgres with `options.returning` true.)
*
* @param {Object} attrValueHash A hash of fields to change and their new values
* @param {Object where Options to describe the scope of the search. Note that these options are not wrapped in a { where: ... } is in find / findAll calls etc. This is probably due to change in 2.0
......@@ -1350,7 +1355,7 @@ module.exports = (function() {
* @param {Number} [options.limit] How many rows to update (only for mysql and mariadb)
* @deprecated The syntax is due for change, in order to make `where` more consistent with the rest of the API
*
* @return {Promise}
* @return {Promise<Array<affectedCount,affectedRows>>}
*/
Model.prototype.update = function(attrValueHash, where, options) {
var self = this;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!