mongoose query $in with case insensitive regex not working
You are doing it wrong. emailArray
should be array of regex also you are missing the $in
in the query.
var emailArray = [ /test@email.com/i, /test2@email.com/i ]db.collection.find({ '$or': [ { 'email': { '$in': emailArray } }, { 'name': 'testUser' } ] })