Hi. I am trying to make a case insensitive database query. My current query is:
return '{"Product":"'+value+'"}';
I tried: return '{"Product":{"$regex":"value", "$options":"i"}}
with no success. Any help?
Hi. I am trying to make a case insensitive database query. My current query is:
return '{"Product":"'+value+'"}';
I tried: return '{"Product":{"$regex":"value", "$options":"i"}}
with no success. Any help?
Hi Cameron,
Your second "where" value is ok:
pre
{"Product":{"$regex":value, "$options":"i"}}
/pre
But there could be error with code wrapping.
Please use this code:
pre
var whereObject = {"Product":{"$regex":value, "$options":"i"}};
return JSON.stringify(whereObject);
/pre
Regards.
Thank you Yurii!