MongoDB case insensitive query on text with parenthesis
If using the $regex
operator with a "string" as input then you must quote literals for reserved characters such as ()
.
Normally that's a single \
, but since it's in a string already you do it twice \\
:
{ "myField" : {
"$regex" : "Ceratonereis \\(Composetia\\) costae" ,
"$options" : "iu"
}}