I might be doing something wrong here, but it looks like $regex queries can't be made case-insensitive. Consider the following example.
{
"selector": {
"title": {
"$regexp": "Bar"
}
}
Having a document with { "title": "Foo Bar Baz" }, the above query will succeed and return the document. However, I'd still like to find it if my regex was bar (lower case).
Using (?i)bar as a regex yield the following error:
Invalid regular expression: /(?i)bar/: Invalid group
I might be doing something wrong here, but it looks like
$regex
queries can't be made case-insensitive. Consider the following example.Having a document with
{ "title": "Foo Bar Baz" }
, the above query will succeed and return the document. However, I'd still like to find it if my regex wasbar
(lower case).Using
(?i)bar
as a regex yield the following error: