mongoose-database-service
Advanced tools
Comparing version 1.0.0 to 1.1.0
16
index.js
@@ -58,2 +58,17 @@ var _ = require('lodash'); | ||
function findById(id) { | ||
var deferred = new Deferred(); | ||
Model.findById(id, function (err, model) { | ||
if (err) { | ||
deferred.internalServerError(err); | ||
} else if (!model) { | ||
deferred.notFound(); | ||
} else { | ||
deferred.success(model); | ||
} | ||
}); | ||
return deferred.promise; | ||
} | ||
function remove(queryObject) { | ||
@@ -77,2 +92,3 @@ var deferred = new Deferred(); | ||
findOne: find.bind(this, true), | ||
findById: findById, | ||
remove: remove | ||
@@ -79,0 +95,0 @@ }; |
{ | ||
"name": "mongoose-database-service", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Promise based database logic for mongoose", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4903
82