|
Hello Sirs!
I'm new to MongoDB and I've just started to learn it, and possibly that my problem has already some solution. Here is my situation:
I'm working on search engine that accepts from user UTF-8 keywords and then searches for the matches in MongoDB collection, returning documents that match. For matching part I could use regex, but the problem is that besides search keywords, user also provides logical expressions in order to narrow the search. So I need to use aggregation pipeline. But the aggregation doesn't provide (as well as I know) means to match against case-insensitive utf-8 substring. For example:
Search keyword is: "jõhvi"
Collection contains such array cells:
"address": "Rahu 26, Jõhvi", "comment": "JÕHVI is a nice city".
So how could be matched keyword Jõhvi against "comment" field, containing same word but in different case in $project of aggregation pipeline? I can use $indexOF in combination with $toLower, but $toLower doesn't handle UTF-8 letters . Please help!
|