Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iridium

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iridium - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

22

dist/lib/Model.js

@@ -318,3 +318,3 @@ "use strict";

}
options = options || {};
const opts = options || {};
if (!_.isPlainObject(conditions))

@@ -324,3 +324,3 @@ conditions = {

};
_.defaults(options, {
_.defaults(opts, {
w: "majority",

@@ -332,10 +332,16 @@ multi: true

return new Bluebird((resolve, reject) => {
this.collection.updateMany(conditions, changes, options, (err, response) => {
if (opts.multi)
return this.collection.updateMany(conditions, changes, opts, (err, response) => {
if (err)
return reject(err);
// New MongoDB 2.6+ response type
if (response.result && response.result.nModified !== undefined)
return resolve(response.result.nModified);
// Legacy response type
return resolve(response.result.n);
});
return this.collection.update(conditions, changes, opts, (err, response) => {
if (err)
return reject(err);
// New MongoDB 2.6+ response type
if (response.result && response.result.nModified !== undefined)
return resolve(response.result.nModified);
// Legacy response type
return resolve(response.result.n);
return resolve(1);
});

@@ -342,0 +348,0 @@ });

@@ -666,2 +666,5 @@ "use strict";

});
it("should allow multi update to be disabled", () => {
return chai.expect(model.update({ _id: { $exists: true } }, { $inc: { answer: 1 } }, { multi: false })).to.eventually.equal(1);
});
it("should allow just the ID to be specified", () => {

@@ -672,2 +675,7 @@ return model.get().then(instance => {

});
it("should allow replacement updates to be conducted", () => {
return model.get().then(instance => {
return chai.expect(model.update(instance._id, instance.document, { multi: false })).to.eventually.equal(1);
});
});
it("should allow filtering using a selector", () => {

@@ -674,0 +682,0 @@ return chai.expect(model.update({ answer: 10 }, { $inc: { answer: 1 } })).to.eventually.equal(1);

{
"name": "iridium",
"version": "7.0.0",
"version": "7.0.1",
"author": "Benjamin Pannell <admin@sierrasoftworks.com>",

@@ -50,3 +50,3 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users",

"engines": {
"node": ">= 0.10"
"node": ">= 6.0"
},

@@ -53,0 +53,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc