Using $text and $search for string searches
I am trying to search a field called prod_desc.
I can successfully search the first word using the $regex.
I need to search the entire string.
for example "Bimbo Extra Soft White Bread" and I want to search Bread
I have tried return '{"prod_desc":{"$text":{"$search":"'+value+'","$options":"i"}}';
and return '{"prod_desc":{"$text":{"$search":"^'+value+'","$options":"i"}}';
Can someone help me find the right way? No tutorial links please...I came up with these strings after searching the mondodb tutorials. Thanks!!