Make sure operator/options are honored
This commit is contained in:
parent
50ac143cea
commit
542afefb1d
|
@ -1139,6 +1139,7 @@ DataAccessObject._coerce = function (where) {
|
|||
}
|
||||
// Check there is an operator
|
||||
var operator = null;
|
||||
var exp = val;
|
||||
if (val.constructor === Object) {
|
||||
for (var op in operators) {
|
||||
if (op in val) {
|
||||
|
@ -1172,7 +1173,7 @@ DataAccessObject._coerce = function (where) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
// Coerce the array items
|
||||
if (Array.isArray(val)) {
|
||||
for (var i = 0; i < val.length; i++) {
|
||||
|
@ -1189,6 +1190,10 @@ DataAccessObject._coerce = function (where) {
|
|||
if (operator) {
|
||||
var value = {};
|
||||
value[operator] = val;
|
||||
if (exp.options) {
|
||||
// Keep options for operators
|
||||
value.options = exp.options;
|
||||
}
|
||||
val = value;
|
||||
}
|
||||
where[p] = val;
|
||||
|
|
Loading…
Reference in New Issue