New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

backbone-db-mongodb

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-db-mongodb - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

19

index.js

@@ -76,2 +76,20 @@ var _ = require('lodash'),

options = options || {};
if (!model.model && !options.where) {
debug('fetch model');
var indexedKeys = _.pluck(model.indexes, 'property');
var objectKeys = Object.keys(model.attributes);
var searchAttrs = {};
_.each(objectKeys, function(attr) {
if(indexedKeys.indexOf(attr) > -1) {
searchAttrs[attr] = model.get(attr);
}
});
if (!Object.keys(searchAttrs).length) {
var err = new Error('Cannot fetch model with given attributes');
return callback(err);
}
options.where = searchAttrs;
}
var query = options.where ||  {};

@@ -104,2 +122,3 @@ var offset = options.offset ||  0;

res = self._filter(res, model);
if(!model.model) return callback(err, res && res.length && res[0]);
callback(err, res);

@@ -106,0 +125,0 @@ });

2

package.json
{
"name": "backbone-db-mongodb",
"version": "0.2.8",
"version": "0.2.9",
"description": "MongoDB driver for Backbone.Db",

@@ -5,0 +5,0 @@ "main": "index.js",

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