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

backbone-db-redis

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-db-redis - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

7

index.js

@@ -381,5 +381,8 @@ var _ = require('lodash'),

var params = _.clone(options.indexKeys);
if (collection.indexSort) params.unshift(options.indexKeys.length); // how many keys to union
if (collection.indexSort) params.unshift(options.indexKeys.length); // how many sets to union
params.unshift(unionKey); // where to store
if (options.weights) {
params.push('WEIGHTS');
params.push.apply(params, options.weights);
}
var unionFn = collection.indexSort ?

@@ -386,0 +389,0 @@ _.bind(this.redis.zunionstore, this.redis) :

{
"name": "backbone-db-redis",
"version": "0.0.35",
"version": "0.0.36",
"description": "Redis driver for Backbone.Db",

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

@@ -46,2 +46,3 @@ var assert = require('assert');

options.unionKey = this.unionKey || options.unionKey;
if (this.indexKey) options.indexKeys.push(this.indexKey);
var args = [this, options];

@@ -239,2 +240,25 @@ return nodefn.apply(_.bind(this.indexDb.readFromIndexes, this.indexDb), args);

it('should read from multiple indexes with weights', function() {
var opts = {
indexKeys: ['test:i:Foo:relation'],
unionKey: 'test:i:UnionFoo',
weights: [1, 10],
score: {
conversion: {
fn: function(score) {
return score;
},
attribute: 'score'
}
}
};
collection2 = new TestCollection2();
return collection2
.readFromIndexes(opts)
.then(function() {
assert.equal(collection2.length, 4);
collection2.at(0).id.should.equal('4');
});
});
it('should fetch models', function(done) {

@@ -277,2 +301,3 @@ var fetchOpts = {

/*
it('should remove model from index', function(done) {

@@ -311,4 +336,4 @@ var model = collection.at(0);

}).otherwise(done);
});
});*/
});
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