It looks like mongodb already supports collation: https://docs.mongodb.com/manual/reference/collation/, and by using that on collection level, we can perform case insensitive queries.
Is there a way to use this collation feature in Doctrine ODM? I want to perform some case insensitive searches.
Using regex is not a solution since collection is huge. I'm also aware of the solutions like converting value to lowercase before hand, or also keeping lowercased version with the original value.
Example from https://jira.mongodb.org/browse/SERVER-90
> db.myCollection.createIndex({city: 1}, {collation: {locale: "en", strength: 2}});
> db.myCollection.insert({_id: 1, city: "New York"});
> db.myCollection.insert({_id: 2, city: "new york"});
> db.myCollection.find({city: "new york"}).collation({locale: "en", strength: 2});
{ "_id" : 1, "city" : "New York" }
{ "_id" : 2, "city" : "new york" }