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

Hello!

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: https://stackoverflow.com/questions/64416507/mongodb-find-how-to-query-for-docs-with-field-containing-a-string-case-inse

Appreciate any help or advice on this! :heart:

Thanks!

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.