node-simple-collectionmodel
Advanced tools
Comparing version 1.3.17 to 1.3.18
@@ -259,21 +259,21 @@ 'use strict'; | ||
async distinct(field, query = {}, options = {}) { | ||
try { | ||
async distinct(field, query = {}) { | ||
return new Promise(async (resolve, reject) => { | ||
const { hrstart, runId } = util.startTimer(); | ||
const documents = await this.Model.distinct(field, query, options) | ||
.lean(); | ||
util.logFunctionTimer({ | ||
file: 'collectionModel.js', | ||
class: this.modelName, | ||
function: 'distinct', | ||
field, | ||
params: query, | ||
hrstart, | ||
runId, | ||
this.Model.distinct(field, query, (err, result) => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
util.logFunctionTimer({ | ||
file: 'collectionModel.js', | ||
class: this.modelName, | ||
function: 'distinct', | ||
field, | ||
params: query, | ||
hrstart, | ||
runId, | ||
}); | ||
return resolve(result); | ||
}); | ||
return documents; | ||
} catch (error) { | ||
console.error(`${this.modelName}.distinct: ${field} ${JSON.stringify(query, null, 4)}: ${error}`); | ||
} | ||
}); | ||
} | ||
@@ -280,0 +280,0 @@ |
{ | ||
"name": "node-simple-collectionmodel", | ||
"description": "A simpel and nice collection model for mongoose stuff.", | ||
"version": "1.3.17", | ||
"version": "1.3.18", | ||
"homepage": "https://github.com/5orenso/node-simple-collectionmodel", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
590