egg-mongoose aggregate 一直报 “Arguments must be aggregate pipeline operators” 不明白
 发布于 8 年前  作者 lpbird  6313 次预览  最后一次回复是 8 年前  来自 问答 

let result= await this.ctx.model.Operate.aggregate([{ $match: {“new_id”: “1234” }}],{});

一只报 Arguments must be aggregate pipeline operators,实在不知道哪里有问题,请各位不吝指教

3 回复
atian25

跟 egg 关系不大,你看下 mongoose 文档吧,看提示是 aggregate 的参数错误

lpbird

@atian25 是的,聚合查询我之前一直用的 ,在别的框架里都是正常的 ,在这就报错,应该跟mongoose版本有关 正在查

lpbird

这个问题我找到了 是数据库版本的问题 不小心用docker 装了个2.4的mongo 装成3.0以上的就好了