I'm trying to create easy search engine and I'm wondering if there is a way to create conditions in query, something like :
Meteor.users.find({
if(gender_given) gender:"something",
if(name_given) name:"something"
});
Right now all that comes to my mind is to create variable with whole Meteor.users.find().fetch()
collection, and then loop through whole array looking for matching records, but I'm sure this is not going to be effective.
Am I missing something?