Comparing version 0.0.17 to 0.0.18
@@ -1527,2 +1527,3 @@ 'use strict'; | ||
Model[methodName] = function (id, options, callback) { | ||
if (callback === undefined) { | ||
@@ -1541,2 +1542,8 @@ callback = options; | ||
var includeNotFound = true; | ||
if (options.unique !== undefined && options.unique === true) { | ||
includeNotFound = false; | ||
} | ||
var _id; | ||
@@ -1559,3 +1566,7 @@ var directObject = extractOption('directObject', options); | ||
if (cachedDocument === null) { | ||
return callback(null, null); | ||
if (includeNotFound) { | ||
return callback(null, null); | ||
} else { | ||
return callback(mongoCollection + ' ' + _id + ' not found'); | ||
} | ||
} | ||
@@ -1592,3 +1603,7 @@ | ||
if (documentLoaded === null) { | ||
return callback(null, null); | ||
if (includeNotFound) { | ||
return callback(null, null); | ||
} else { | ||
return callback(mongoCollection + ' ' + _id + ' not found'); | ||
} | ||
} | ||
@@ -1595,0 +1610,0 @@ |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"engines": { | ||
@@ -11,0 +11,0 @@ "node": ">=0.4.12" |
Sorry, the diff of this file is not supported yet
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
97285
2014