From a119f634f9a22c657d49e159c24cbbc1c8f16633 Mon Sep 17 00:00:00 2001 From: Sander Steenhuis Date: Sat, 21 Jul 2018 20:15:19 +0200 Subject: [PATCH] Make ':contains' filter case insensitive; fixes #57 The `:` filter should be case insensitive as is the case with [other store providers](https://github.com/holidayextras/jsonapi-store-relationaldb/blob/61c160ae9c13e5a37dcdd1e57962ce1eaf6680cd/lib/sqlHandler.js#L322-L325). --- lib/mongoHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongoHandler.js b/lib/mongoHandler.js index bcb4849..370e32a 100644 --- a/lib/mongoHandler.js +++ b/lib/mongoHandler.js @@ -67,7 +67,7 @@ MongoStore._filterElementToMongoExpr = function(filterElement) { ">": { $gt: value }, "<": { $lt: value }, "~": new RegExp("^" + value + "$", "i"), - ":": new RegExp(value) + ":": new RegExp(value, "i") }[filterElement.operator]; return mongoExpr; };