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

node-entity

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

node-entity - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

25

adaptors/mongoose.adp.js

@@ -63,9 +63,15 @@ /**

MongooseAdapter.prototype._create = function(itemData) {
var self = this;
return new Promise(function(resolve, reject) {
var item = new this.Model(itemData);
var item = new self.Model(itemData);
item.save(function(err, document) {
if (err) { return reject(err); }
resolve(document);
if (self._hasEagerLoad) {
self._readOne(document._id).then(resolve, reject);
} else {
resolve(document);
}
});
}.bind(this));
});
};

@@ -191,4 +197,5 @@

if (!this.Model) { throw new Error('No Mongoose.Model defined, use setModel()'); }
var self = this;
return new Promise(function(resolve, reject) {
this.readOne(id).then(function(doc) {
self.readOne(id).then(function(doc) {
if (!__.isObject(doc)) {

@@ -199,11 +206,11 @@ return reject(new Error('record not found'));

doc[key] = value;
}, this);
});
doc.save(function(err, document) {
doc.save(function(err) {
if (err) { return reject(err); }
resolve(document);
resolve(doc);
});
}.bind(this), reject);
}.bind(this));
}, reject);
});
};

@@ -210,0 +217,0 @@

{
"name": "node-entity",
"description": "The MVCe implementation for Node.js",
"version": "0.2.8",
"version": "0.2.9",
"homepage": "https://github.com/thanpolas/entity",

@@ -6,0 +6,0 @@ "author": {

@@ -475,2 +475,4 @@ # Entity

- **v0.2.9**, *03 Jul 2014*
- optimizations and fixes on eager loading for mongoose.
- **v0.2.8**, *03 Jul 2014*

@@ -477,0 +479,0 @@ - Introduce eager loading mechanisms.

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