I am trying to use the regex with $in operator as mentioned in the docs but I am still unable to get the value.
db.users.find({'profile.firstName':{$in:["/justin/i"]}}).count() = 0
but when I used like this
db.users.find({'profile.firstName':{$in:["justin"]}}).count()=1
and
db.users.find({'profile.firstName':{$in:["Justin"]}}).count()=2
Edited Question
seems like I am not clear with the question I will add the code for easy understanding
I am trying to get the list of documents from a query which is case insensitive.I think it better to explain my doubt with code.
Meteor.users.find({'profile.firstName':{$in:[/justin/i,/helen/i]}}).count()
will give documents whose profile.firstName is justin/Justin/JUSTIn/HElen/helen
but my doubt how to give the variable x=["sai","test","jacob",---etc] in place of helen/justin