Comparing version 1.0.1 to 1.1.0
@@ -52,6 +52,20 @@ 'use strict'; | ||
* @param {Object} query Specific id or query to construct read | ||
* @param {Number|String} version The version of the model to match | ||
* @returns {Object} promise | ||
*/ | ||
nedb.read = function (query) { | ||
return nedb.db.findAsync(query); | ||
var version = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; | ||
var sanitize = this.sanitize; | ||
return new Promise(function (resolve, reject) { | ||
nedb.db.findAsync(query).then(function (results) { | ||
var tmp = []; | ||
results.forEach(function (r) { | ||
tmp.push(sanitize(r, version)); | ||
}); | ||
resolve(tmp); | ||
})['catch'](function (err) { | ||
return reject(err); | ||
}); | ||
}); | ||
}; | ||
@@ -58,0 +72,0 @@ |
{ | ||
"name": "modli-nedb", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Modli adapter for NeDB", | ||
@@ -5,0 +5,0 @@ "main": "build/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
54496
488