云库的result集合查询结果集问题?
发布于 7 年前 作者 sunfang 9094 次浏览 来自 问答

同样的脚本及sql,为什么IDE中没结果,正式上线的小程序中有结果。期望的就是应该都查询到结果!

const my = db.command.aggregate

    db.collection('results').aggregate().group({_id: { result: '$voteResult' },count: my.sum(1),}).sort({count: -1})

      .skip(0)

      .limit(5)

      .end({

        success(res){

          console.log(res.list);

          _this.setData({

          doShowDefaultVotes: true

          voteResult: res.list,

          })

        },

      })

1 回复

IDE什么错误提示?aggregate不支持吧?

回到顶部