Page 1 of 1

how to search database on two fields using regex

Posted: Wed Dec 18, 2013 8:06 am
by Ketan Patil

i wan to search into two fields form database.
if one is true i want to return that row.
for one field i am using the code
return '{"cat":{"$regex":"^'+value+'", "$options":"i"}}';

what would be the code for two fields?

pl. help


how to search database on two fields using regex

Posted: Wed Dec 18, 2013 8:17 am
by Maryna Brodina