stockshark-data-access
Advanced tools
Comparing version 1.0.44 to 1.0.45
{ | ||
"name": "stockshark-data-access", | ||
"version": "1.0.44", | ||
"version": "1.0.45", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -33,2 +33,7 @@ const MongoClient = require('mongodb').MongoClient; | ||
const result = await coll.findOne({ _id: id }, { projection }) | ||
if (this._defined(field)) { | ||
result = this._postProcess(result, field) | ||
} | ||
return result | ||
@@ -233,3 +238,8 @@ } | ||
if (typeof field === "string") { | ||
result = result.map(p => util.getObjValueByPath(p, field)) | ||
if (Array.isArray(result)) { | ||
result = result.map(p => util.getObjValueByPath(p, field)) | ||
} | ||
else { | ||
result = util.getObjValueByPath(result, field) | ||
} | ||
} | ||
@@ -236,0 +246,0 @@ return result |
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
17621
308