I am trying to perform a search in a mongo document that has the energy word saved in the name, I make the query in the following way:
{'$match': {
'name': {
'$regex': '.*energetico.*',
'$options': 'i'
}
}}
But I do not get results until I put the accent, look in Mongo's documentation and $ diacriticSensitive appeared, but when I put it in my code I get the error: 'unknown operator: $ diacriticSensitive'
Is there any way to perform the search regardless of whether you have an accent so that I can return a result?