Comparing version 2.11.4 to 2.12.0
@@ -537,3 +537,3 @@ var _ = require('lodash'), | ||
Model.prototype.update = function (conditions, changes, callback) { | ||
Model.prototype.update = function (conditions, changes, options, callback) { | ||
/// <signature> | ||
@@ -545,6 +545,25 @@ /// <summary>Updates all documents in the collection which match the specified conditions - making the requested changes</summary> | ||
/// </signature> | ||
/// <signature> | ||
/// <summary>Updates all documents in the collection which match the specified conditions - making the requested changes</summary> | ||
/// <param name="conditions" type="Object">The conditions used to select objects to be updated</param> | ||
/// <param name="changes" type="Object">The changes to be made to objects in the collection</param> | ||
/// <param name="options" type="Object">The options to be passed to the update method</param> | ||
/// <param name="callback" value="(function(err, count) { })">A function to be called once the update has completed</param> | ||
/// </signature> | ||
options = options || {}; | ||
if(typeof options == 'function') { | ||
callback = options; | ||
options = {}; | ||
} | ||
_.defaults(options, { | ||
w: callback ? 1 : 0, | ||
multi: true | ||
}); | ||
this.toSource(conditions); | ||
this.collection.update(conditions, changes, { w: callback ? 1 : 0, multi: true }, (function(err, modified) { | ||
this.collection.update(conditions, changes, options, (function(err, modified) { | ||
if (err) this.emit('error', err); | ||
@@ -551,0 +570,0 @@ return callback(err, modified); |
{ | ||
"name": "iridium", | ||
"version": "2.11.4", | ||
"version": "2.12.0", | ||
"author": "Benjamin Pannell <admin@sierrasoftworks.com>", | ||
@@ -5,0 +5,0 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156529
34
2901