为什么我不能使用 $lookup?

Why can't I use $lookup?

我正在尝试使用 aggregate and reactive-aggregate 在流星 mongo 中使用 $lookup 聚合阶段。不幸的是我收到了这个错误。

Exception from sub Feed id H3yhzuXdAk6LuQa7h MongoError: exception: Unrecognized pipeline stage name: '$lookUp'

我知道我不是唯一一个在流星博客上苦苦挣扎的人,https://forums.meteor.com/t/new-mongodb-lookup-aggregation-operator-in-3-2/6784,所以任何输入的想法、解决方法,但最特别的是 $lookup 反应聚合的工作源代码示例太好了。

编辑:好的,所以我通过单击 test.bat

启动我的流星应用程序
cd "."
start myDb.bat
start dbShell.bat
%MONGO_URL%=mongodb://localhost:27017/common
start met.bat
start "google chrome" http://localhost:3000

mydb.bat

mongod

met.bat

meteor

bdShell.bat

mongo

link.bat

start "google chrome" http://localhost:3000

问题是 meteor 的默认 mongo 固定在 2.6.7(在 1.3 版本的 meteor)。

将您的 mongo url 设置为 3.2 数据库以使用查找

$ MONGO_URL=mongodb://localhost/meteor meteor

(其中 mongo url 指向 3.2 分贝)