Don't enforce strictness if allowExtendedOperators: true (MongoDB)

This commit is contained in:
Fabien Franzen 2015-07-22 17:09:04 +02:00
parent c7caa0a7c1
commit a94993c097
1 changed files with 4 additions and 1 deletions

View File

@ -2297,6 +2297,9 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, op
assert(typeof connector.updateAttributes === 'function',
'updateAttributes() must be implemented by the connector');
var allowExtendedOperators = connector.settings
&& connector.settings.allowExtendedOperators;
var strict = this.__strict;
var model = Model.modelName;
var hookState = {};
@ -2335,7 +2338,7 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, op
if (err) return cb(err);
data = ctx.data;
if (strict) {
if (strict && !allowExtendedOperators) {
var props = Model.definition.properties;
var keys = Object.keys(data);
var result = {};