Fixed IN and NOT IN when searching on strings
This commit is contained in:
parent
799fe31b10
commit
f17716272c
|
@ -157,6 +157,11 @@ MySQL.prototype.toDatabase = function (prop, val) {
|
|||
this.toDatabase(prop, val[1]);
|
||||
} else if (operator == 'inq' || operator == 'nin') {
|
||||
if (!(val.propertyIsEnumerable('length')) && typeof val === 'object' && typeof val.length === 'number') { //if value is array
|
||||
for (var i = 0; i < val.length; i++) {
|
||||
if (typeof val[i] === 'string') {
|
||||
val[i] = this.client.escape(val[i]);
|
||||
}
|
||||
}
|
||||
return val.join(',');
|
||||
} else {
|
||||
return val;
|
||||
|
|
Loading…
Reference in New Issue