Query a an exact string while ignoring case
I am trying to query on a string. I want a value returned only if the entire string is matched, but I want to ignore case.
How do I do it ?
The below works well, except that it will return values even is the string contains part of the expression. In the below expression, I expect to get a record where the string matches "wrench"
{"ItemType":{"$regex":"wrench", "$options":"i"}}';
however, the below also returns the same exact result as the above.
{"ItemType":{"$regex":"renc", "$options":"i"}}';
Obviously, I am missing something. Please help.
Thanks