Stumped trying to query for field containing a string, case insensitive and diacritic sensitive


I am having an extremely difficult time creating the right syntax to query documents for my application.

I have written out a whole SO question describing it here: regex - MongoDB "find" - How To Query For Docs With Field Containing a String, Case Insensitive And Diacritic Sensitive? - Stack Overflow

Appreciate any help or advice on this! :heart:


Hello @James_Lynch,

You can try this filter using regex with your find query: { title: { $regex: searchText, $options: "i" } }

The searchText variable value, for example is "home" (and this returns the first 3 documents from your sample collection).

Thanks @Prasad_Saya!

When I try this though it matches for “höme” where I would like them to be distinct from each other.