跳到主要内容
CNode

egg-mongoose aggregate 一直报 “Arguments must be aggregate pipeline operators” 不明白

问答
Llpbird发布于 9 年前最后回复 9 年前
365300

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

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

查看回复

回复 (3)

L
lpbird#39 年前

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

L
lpbird#29 年前
引用 atian25跟 egg 关系不大,你看下 mongoose 文档吧,看提示是 aggregate 的参数错误

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

A
atian25#19 年前

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

参与回复

登录后即可参与回复。登录