大神,请问为什么直接对比常量,也报权限错误? { "read": true, "write": "(resource.openid == auth.openid) || (auth.openid == 'QbBeVP-GY')" }
新版数据库自定义权限设置创建者可读写问题[图片][图片]
2021-04-12借楼求问:为什么相同环境相同数据库相同表,可以用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)}) [图片]
云开发调用云函数出错已安装node.js 8.9.0 并安装wx-server-sdk,已创建云函数并上传云平台,访问云函数时报错 WACloud.js:1 Uncaught (in promise) Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -501005, error message Environment not found; at cloud.callFunction api; 调用代码: onLoad(){ wx.cloud.init({ env: 'text' }) wx.cloud.callFunction({ name:'add', data:{ a:12, b:19 } }).then(console.log) }
2021-02-07相同环境下,photos.where().get()运行正常反馈结果。~~~~ 说明云环境没有问题。 但是相同代码段内 photos.aggregate().end() 报错501000 。~~~~却说云环境有问题,很矛盾了,云环境如上验证是正常的。
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 [图片]
2021-01-20请问大佬:1、请问为什么在相通环境下,相同代码段内 photos.aggregate().end() 报错501000 ? 而同时photos.where().get()运行正常反馈结果。错误信息及代码如下。 https://developers.weixin.qq.com/community/develop/doc/00068c62754460db469b27b175ac00
云开发数据库collection.field 数组字段 project.slice方法使用不了?[代码]const $ = db.command.project[代码][代码]await db.collection([代码][代码]'chat'[代码][代码]).where({[代码][代码] [代码][代码]_id: event.id[代码][代码] [代码][代码]}).field({[代码][代码] [代码][代码]_id: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]chatReqUserId: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]chatResUserId: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]record: $.slice(-2)[代码][代码] [代码][代码]}).get()[代码] [代码]const $ = db.command.project[代码][代码]await db.collection([代码][代码]'chat'[代码][代码]).where({[代码][代码] [代码][代码]_id: event.id[代码][代码] [代码][代码]}).field({[代码][代码] [代码][代码]_id: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]chatReqUserId: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]chatResUserId: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]record: {[代码] tags: $.slice(-2) [代码] }[代码] [代码] [代码][代码]}).get()[代码] 报错信息: Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 9e68d720-fa24-11e9-b2dd-525400e8849e, cloud function service error code -504002, error message errCode: -501007 invalid parameters | errMsg: [InvalidParameterValue.QueryProjection] Query projection entered in the request is illegal. Please check your request, but if the problem persists, contact us.; ; at cloud.callFunction api; 文档地址: https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-server-api/database/collection.field.html 两种方法都测试过了,返回了同样的报错信息,然后在command列表文档下也找不到project这个方法,不知道是否是该方法已被废除,求大佬帮忙,万分感谢
2021-01-20