How to use $geonear and $search in the same stage

Hi, i’d like to know if there is a way to use something similar to $geonear and $text:$search in the same stage.

The alternative that i’m using is a regex, but it’s not the same.


Welcome to MongoDB community.

You can’t use both of those stages in the same aggregation as they use different index types (geo and text).

What we do offer is the Atlas search product if you willing to run your database on atlas, and you should:

Here you can run near and text search in a compound expression.