即使收到以下錯誤,我仍在使用最新版本的mongodb 3.6 ...MongoError: The 'cursor' option is required, except for aggregate with the explain argumentconst user = await User.aggregate([ { $group: { _id: '$_id', domain: { $push: "$domain" }, domain: { $push: "$email" }, domain: { $push: "$userName" } } } ])
1 回答

慕標琳琳
TA貢獻1830條經驗 獲得超9個贊
更新貓鼬。5.0之前的Mongoose版本與MongoDB 3.6不正確匹配。MongoDB 3.6將聚合API從“ cursor optional”更改為“ cursor only”,并且較舊的mongoose版本通過嘗試使用不建議使用的方法來請求數組來打破這一點。
- 1 回答
- 0 關注
- 1066 瀏覽
添加回答
舉報
0/150
提交
取消