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

cmbf-hapi-restmodel

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmbf-hapi-restmodel - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

18

lib/base-model.js

@@ -77,6 +77,6 @@ var Joi = require('joi'),

options = options || {};
var coll = this.constructor.db.collection(this.constructor.collection);
var coll = this.db.collection(this.collection);
return coll.find(options.filter).toArray().then((results) => {
if(options.wrap) {
return P.map(results, function(r){ return this.constructor.wrap(r)});
return P.map(results, function(r){ return this.wrap(r)});
}

@@ -90,9 +90,9 @@ else {

static show(id) {
log.debug("show %s ", this.constructor.name, id);
log.debug("show %s ", this.name, id);
var _this = this;
var coll = this.constructor.db.collection(this.constructor.collection);
var coll = this.db.collection(this.collection);
var q = {};
q[this.constructor.idField] = id;
q[this.idField] = id;
return coll.findOne(q).then(function(data) {
return _this.constructor.wrap(data);
return _this.wrap(data);
});

@@ -102,3 +102,3 @@ }

static wrap(data) {
if(!(data instanceof this.constructor)) {
if(!(data instanceof this)) {
return new this(data);

@@ -140,5 +140,5 @@ }

log.debug("Remove", id);
var coll = this.constructor.db.collection(this.constructor.collection);
var coll = this.db.collection(this.collection);
var q= {};
q[this.constructor.idField] = id;
q[this.idField] = id;
return coll.removeOne(q);

@@ -145,0 +145,0 @@ }

{
"name": "cmbf-hapi-restmodel",
"version": "0.4.5",
"version": "0.4.6",
"author": "Joel Grenon <joelgrenon@covistra.com>",

@@ -5,0 +5,0 @@ "description": "Hapi plugin building a REST Api from Joi schema, backed by covistra-mongo plugin",

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