From 404e0db1b8815bee6e89c6ad83625ec3758137de Mon Sep 17 00:00:00 2001 From: Bram van der Veen <96aa48@gmail.com> Date: Wed, 17 Jun 2015 12:25:14 +0200 Subject: [PATCH] Added case ignore in lookup --- lookup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lookup.js b/lookup.js index 32a4519..239709b 100644 --- a/lookup.js +++ b/lookup.js @@ -8,6 +8,7 @@ var school_id = config().school_id; //Function for looking through the database and finding entries related to the searchterm. function lookup(req, res, next, search) { var index = database.collection('index'); + search = new RegExp(search, 'i'); //Make regular exeption for ignoring the case (Bram vs BRAM) should return the same. index.find({$or : [{id : search}, {name : search}, {first_name : search}, {last_name : search}]}).toArray(function (err, database_entry) { if (err) console.warn(err);