首页 > 解决方案 > MongoDB Compass 应用程序没有 $search 聚合

问题描述

我在 Mac 中使用 MongoDB Compass 应用程序,它连接到我的本地主机数据库。我无法$search在所有可用聚合的列表中看到聚合。不确定这是否是由于 MongoDB 版本。

我正在使用的数据库信息:

HOST: localhost:27017
CLUSTER: Standalone
EDITION: MongoDB 4.4.3 Community

所有可用聚合列表中缺少 $search

标签: mongodbaggregation-frameworkmongodb-compass

解决方案


$search聚合管道阶段对Atlas集合中的一个或多个字段执行全文搜索。

您只能$searchfind阶段使用。

签出这个例子:$search


推荐阅读