Socket
Socket
Sign inDemoInstall

backbone-db-elasticsearch

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-db-elasticsearch - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

8

index.js

@@ -95,6 +95,10 @@ var _ = require('lodash');

}
this.client.update(this.getESOptions(model, {
var updateOpts = this.getESOptions(model, {
includeBody: true,
update: true
}), function(error, resp) {
});
if (options.upsert) {
updateOpts.body.upsert = _.clone(updateOpts.body.doc);
}
this.client.update(updateOpts, function(error, resp) {
callback(error, model.toJSON());

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

{
"name": "backbone-db-elasticsearch",
"version": "0.1.9",
"version": "0.1.10",
"description": "Elasticsearch driver for backbone-db",

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

@@ -90,2 +90,25 @@ var setup = require('./setup');

it('should upsert a document', function() {
var model2 = new this.Model({id: 2, value: 99});
return model2.save(null, {
update: true,
upsert: true
});
});
it('should fetch upserted doc', function() {
var model2 = new this.Model({id: 2});
return model2
.fetch()
.then(function() {
var json = model2.toJSON();
json.value.should.equal(99);
});
});
it('should delete the upserted doc', function() {
var model2 = new this.Model({id: 2});
return model2.destroy();
});
describe('Index CRUD', function() {

@@ -92,0 +115,0 @@ it('should create index', function(next) {

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