0

I have a collection like

{

"email" : "[email protected]"

}

My query should be like , it has to find matching email irrespective of case whether its capital or small but it should match exactly.

In sql we will do like where Lower(strEmail) = Lower(@emailParameterPassed) to satisfy this same.

UPDATE

I got it here. Thanks

How to achieve this in mongoDb?

I am using c# native driver with mongoDb ?

0

1 Answer 1

1

Nonetheless the answer you are duplicating will give you a correct result, it is not a good idea to do queries like this. Why should you use regex (without indexes ) if you can use normal equal and take advantage of indexes?

There is no difference between [email protected] and [email protected] so why not to store them in a canonical form in the first place and then to use normal search. To change all the documents, you can refer to my previous answer.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.