Socket
Socket
Sign inDemoInstall

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 2.13.0 to 2.13.1

11

lib/Model.js

@@ -515,6 +515,13 @@ var _ = require('lodash'),

if(queryOptions.upsert)
this.collection.findAndModify({ _id: prepped._id }, { _id: 1 }, prepped, queryOptions, (function(err, inserted) {
async.parallel(_.map(prepped, function(doc) {
return (function(done) {
this.collection.findAndModify({ _id: doc._id }, { _id: 1 }, doc, queryOptions, function(err, result) {
if(err) return done(err);
return done(null, result);
});
}).bind(this);
}, this), (function(err, inserted) {
if (err) return end(err);
if(callback)
return this.onRetrieved(null, inserted[0], end, null, { wrap: options.wrap, cache: options.cache });
return this.onRetrieved(null, inserted, end, null, { wrap: options.wrap, cache: options.cache });
return end();

@@ -521,0 +528,0 @@ }).bind(this));

2

package.json
{
"name": "iridium",
"version": "2.13.0",
"version": "2.13.1",
"author": "Benjamin Pannell <admin@sierrasoftworks.com>",

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

@@ -99,2 +99,17 @@ var config = require('./config.js');

});
it('should support upsert operations with multiple documents', function(done) {
model.create([{
name: 'Demo1',
upserted: true
},{
name: 'Demo5',
upserted: true
}], { upsert: true }, function(err, updated) {
should.not.exist(err);
should.exist(updated);
updated.length.should.equal(2);
done();
});
});
});

@@ -101,0 +116,0 @@ });

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