Definition定义
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 Vector Search.$vectorSearch聚合管道阶段仅适用于运行MongoDB 6.0.11或更高版本的MongoDB Atlas集群层上托管的集合。要了解更多信息,请参阅矢量搜索。
$vectorSearch$vectorSearchperforms a semantic search on data in your Atlas cluster.对Atlas集群中的数据执行语义搜索。If you store vector embeddings on your Atlas cluster, you can seamlessly index the vector data along with your other collection data.如果将向量嵌入存储在Atlas集群上,则可以将向量数据与其他集合数据无缝地索引。You can use the您可以使用$vectorSearchstage to pre-filter your data and perform semantic search against the indexed fields.$vectorSearch阶段预筛选数据,并对索引字段执行语义搜索。Your vector data must be less than or equal to 4096 dimensions in width.矢量数据的宽度必须小于或等于4096维。
Behavior行为
Starting in MongoDB 8.0, you can use a 从MongoDB 8.0开始,您可以在$vectorSearch stage in a $unionWith stage.$unionWith阶段中使用$vectorSearch阶段。
Limitations局限性
You cannot use a 您不能在$vectorSearch stage in a $facet stage or a $lookup stage.$facet阶段或$lookup阶段中使用$vectorSearch阶段。
Learn More了解更多
To learn more about creating Vector Search indexes, see Index Vector Embeddings.要了解有关创建向量搜索索引的更多信息,请参阅索引矢量嵌入。To learn more about要了解有关$vectorSearchpipeline stage syntax and usage, see Vector Search Queries.$vectorSearch管道阶段语法和用法的更多信息,请参阅矢量搜索查询。