Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function find(db, requestDef, explain) {
if (requestDef.selector) {
requestDef.selector = massageSelector(requestDef.selector);
}
if (requestDef.sort) {
requestDef.sort = massageSort(requestDef.sort);
}
if (requestDef.use_index) {
requestDef.use_index = massageUseIndex(requestDef.use_index);
}
validateFindRequest(requestDef);
return getIndexes(db).then(function (getIndexesRes) {
db.constructor.emit('debug', ['find', 'planning query', requestDef]);
var queryPlan = planQuery(requestDef, getIndexesRes.indexes);
get: function get() {
if (!this._massageSelector) {
var selector = this.mquery._conditions;
this._massageSelector = massageSelector(selector);
}
return this._massageSelector;
}
}]);
get massageSelector() {
if (!this._massageSelector) {
const selector = this.mquery._conditions;
this._massageSelector = massageSelector(selector);
}
return this._massageSelector;
}
public id: number = newQueryID();