Add like/nlike support

This commit is contained in:
Raymond Feng 2014-05-29 15:16:14 -07:00
parent 33b86b51b2
commit a41c7f5c7a
1 changed files with 6 additions and 0 deletions

View File

@ -450,6 +450,12 @@ MySQL.prototype._buildWhere = function (model, conds) {
case 'neq': case 'neq':
sqlCond += ' != '; sqlCond += ' != ';
break; break;
case 'like':
sqlCond += ' LIKE ';
break;
case 'nlike':
sqlCond += ' NOT LIKE ';
break;
} }
sqlCond += (condType === 'inq' || condType === 'nin') ? '(' + val + ')' : val; sqlCond += (condType === 'inq' || condType === 'nin') ? '(' + val + ')' : val;
cs.push(sqlCond); cs.push(sqlCond);