Hi everyone,
I would like to obtain the results of a text search with the results of a regex. In particular, assuming that the input string is “substring”, I would like to be able to do the following filter:
{ $or : [ { name : { $regex : “.substring.” } }, {$text : { $search: “substring” } } ] }
Of course, I’ve previously created the $text index on “name” field, however it gives me a Mongo Error since $or and $text operator cannot be used together.
How can I achieve this filtering?
Thanks in advance