db.collection.aggregate无法正常运行 ,报错501000 ?
为什么相同环境相同数据库相同表相同代码内,可以用get查询,不能用aggregate查询? 完整代码如下。报错如图:环境错误。 onLoad: function (options) {
const db = wx.cloud.database()
db.collection('orders').aggregate()
.match({price:30})
.end()
.then(res => {console.log('collection aggregate success:',res)})
.catch(err => {console.log('collection aggregate error:',err)})
db.collection('orders').get()
.then(res => {console.log('collection get success:',res)})
.catch(err => {console.log('collection get error:',err)})
报错信息如下: Error: errCode: -501000 | errMsg: Environment not found at new u (WAService.js:1) at Function.success (WAService.js:1) at Object.success (WAService.js:1) at r (WAService.js:1) at WAService.js:1 at v (WAService.js:1) at WAService.js:1 at VM8 asdebug.js:1 [图片]