I'm trying to write a MongoDB query with Mongoose in Node.JS to get all names in a database matching a certain name. I would like that the query ignores the case and accents.
I looked around on the internet but couldn't find a query that does that.
MongoDB queries support regexes so that's what I'm trying to do.
This is what I have now. It works but doesn't match if the query or the queried string has accents and the other doesn't.
Passenger_record.find({$and: [{"FIRSTNAME": { $regex:req.query["firstname"], $options: 'i' }},{"LASTNAME": { $regex:req.query["lastname"], $options: 'i' }}]}).exec(function (err, person)
Thanks for your help.