Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.execute(modelName, 'findOne', {_id: oid}, function(err, data) {
if (self.debug) {
debug('find.callback', modelName, id, err, data);
}
data = self.fromDatabase(modelName, data);
if (data && idName !== '_id') {
delete data._id;
}
if (callback) {
callback(err, data);
}
});
};
Connector.defineAliases(MongoDB.prototype, 'find', 'findById');
/**
* Parses the data input for update operations and returns the
* sanitised version of the object.
*
* @param data
* @returns {*}
*/
MongoDB.prototype.parseUpdateData = function(modelName, data, options) {
options = options || {};
const parsedData = {};
const modelClass = this._models[modelName];
let allowExtendedOperators = this.settings.allowExtendedOperators;
if (options.hasOwnProperty('allowExtendedOperators')) {