Learn the "why" behind slow queries and how to fix them in our 2-Part Webinar.
Register now >
Docs 菜单
Docs 主页
/ /

$vectorSearch(聚合阶段)

$vectorSearch

$vectorSearch 对Atlas 集群中的数据执行语义搜索。

如果您在Atlas 集群上存储向量嵌入,则可以将向量数据与其他集合数据一起无缝索引。您可以使用 $vectorSearch 阶段来预筛选数据并对索引字段执行语义搜索。

矢量数据的宽度必须小于或等于 4096 维度。

$vectorSearch聚合管道阶段在以下环境中可用:

  • MongoDB Atlas 运行版本为6.0.11或更高的集群

  • MongoDB Enterprise 部署运行版本为 8.2 或更高版本的 Kubernetes 操作符

  • MongoDB Community 运行版本8.2或更高的部署

要学习;了解更多信息,请参阅MongoDB Vector Search。

从MongoDB8.0 开始,您可以在 阶段中使用$vectorSearch $unionWith阶段。

您不能在$vectorSearch $facet阶段或$lookup 阶段中使用 阶段。

后退

$unwind