From d7007da7738bf6cd62e1f1938fac1daf033b9ffd Mon Sep 17 00:00:00 2001 From: Jhon Nova Date: Tue, 31 Jul 2018 14:30:49 -0500 Subject: [PATCH] Updating Like Criteria Updating regular expression in Like criteria for case insensitive. --- lib/private/machines/private/build-mongo-where-clause.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/machines/private/build-mongo-where-clause.js b/lib/private/machines/private/build-mongo-where-clause.js index 26d74afe7..646de4548 100644 --- a/lib/private/machines/private/build-mongo-where-clause.js +++ b/lib/private/machines/private/build-mongo-where-clause.js @@ -211,7 +211,7 @@ module.exports = function buildMongoWhereClause(whereClause, WLModel, meta) { break; case 'like': - constraint['$regex'] = new RegExp('^' + _.escapeRegExp(modifier).replace(/^%/, '.*').replace(/([^\\])%/g, '$1.*').replace(/\\%/g, '%') + '$'); + constraint['$regex'] = new RegExp('^' + _.escapeRegExp(modifier).replace(/^%/, '.*').replace(/([^\\])%/g, '$1.*').replace(/\\%/g, '%') + '$','i'); break; default: