Atlas Search queries are run as an aggregation pipeline stage. If you have an existing Atlas Search Index for data on your Atlas cluster, you can run $search and $searchMeta queries. If you have an existing Atlas Vector search index on your data in Atlas, you can also run $vectorSearch queries.
Before You Begin
Create an Atlas Search index or an Atlas Vector Search index.
Note
Atlas Search index management in the Compass UI is available only for:
Atlas local deployments.
Deployments running MongoDB 7.0 or later.
Steps
Construct your query
By default, MongoDB Compass selects the $search stage for your query. You can also select the $searchMeta stage to use in your query. If you are using a vectorSearch type index in your query, you can use the $vectorSearch stage.
Note
If you use the $search, $searchMeta, or $vectorSearch stage, it must be the first stage in your aggregation pipeline. To combine vector and full-text search in the same pipeline, perform a hybrid search. For more information, see How to Perform Hybrid Search.