Group (By) in Mongoose?

后端 未结 4 1212
盖世英雄少女心
盖世英雄少女心 2021-02-12 15:18

I\'ve constructed the query I want in the shell but am having trouble writing it in Mongoose.

db.commentstreams.group({ key: { page_id: true }, reduce: function(         


        
4条回答
  •  自闭症患者
    2021-02-12 15:44

    if you're trying to use Mongoose to group maybe you're better take a look at this Mongoose group query in node.js / express route

    It seems group is not supported by Mongoose while aggregate is.

提交回复
热议问题