【笔记】云函数,聚合函数aggregate不支持where,只能是纯聚合

发布于 6 年前作者 xia282272 次浏览最后编辑 6 年前来自 share

占位

db.collection('question').where({

      category: _id

    })

    .aggregate()

    .sample({

      size: num

    })

    .end()

    .then(res => {

      console.log('[数据库] [查询记录] 成功: ', res)

    })

占位

占位

2 回复