Added case ignore in lookup
This commit is contained in:
parent
f10f4f9cd2
commit
404e0db1b8
|
@ -8,6 +8,7 @@ var school_id = config().school_id;
|
||||||
//Function for looking through the database and finding entries related to the searchterm.
|
//Function for looking through the database and finding entries related to the searchterm.
|
||||||
function lookup(req, res, next, search) {
|
function lookup(req, res, next, search) {
|
||||||
var index = database.collection('index');
|
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) {
|
index.find({$or : [{id : search}, {name : search}, {first_name : search}, {last_name : search}]}).toArray(function (err, database_entry) {
|
||||||
if (err) console.warn(err);
|
if (err) console.warn(err);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue