Docs Menu
Docs Home
/
MongoDB Manual
/ / /

$vectorSearch (aggregation)

Important

The $vectorSearch aggregation pipeline stage is only available for collections hosted on MongoDB Atlas cluster tiers running MongoDB version 6.0.11 or later. To learn more, see Atlas Vector Search.

$vectorSearch

$vectorSearch performs a semantic search on data in your Atlas cluster.

If you store vector embeddings on your Atlas cluster, you can seamlessly index the vector data along with your other collection data. You can use the $vectorSearch stage to pre-filter your data and perform semantic search against the indexed fields.

Your vector data must be less than or equal to 4096 dimensions in width.

Starting in MongoDB 8.0, you can use a $vectorSearch stage in a $unionWith stage.

You cannot use a $vectorSearch stage in a $facet stage or a $lookup stage.

Back

$unwind