{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: errCode: -502001 database request fail | errMsg: Update Fail: write errors: [{The dollar ($) prefixed field '$push' in 'cusers.$push' is not valid for storage.}]; \n at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:2503:28)\n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:2555:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1260:23)\n at Query.\u003canonymous\u003e (/var/user/node_modules/wx-server-sdk/index.js:1358:41)\n at step (/var/user/node_modules/tslib/tslib.js:133:27)\n at Object.next (/var/user/node_modules/tslib/tslib.js:114:57)\n at fulfilled (/var/user/node_modules/tslib/tslib.js:104:62)\n at \u003canonymous\u003e\n at process._tickCallback (internal/process/next_tick.js:188:7)"}
求官方回答,自测找不出原因
调用成功的那几个是用另外的方法实现的,但是push是不行的
遇到同样问题,原因是云开发sdk的bug.
你看一下你云函数目录下,package-lock.json里面wx-server-sdk的版本号是多少。
测试用0.0.19可以正常_.push.但小于0.0.20的版本在update嵌套JSON时会出错。
受不了了。
过一段时间有空还是重构一下版本。靠别人api过日子,各种bug搞死人。
看了是0.0.20,没有测试0.0.19
0.0.20有这个问题。往前一直测到12都一样。倒是0.0.2两个都正常
我也一直是这个问题,解决了三四天,都没有找到原因。
{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: errCode: -502001 database request fail | errMsg: Update Fail: write errors: [{The dollar ($) prefixed field '$push' in 'cusers.$push' is not valid for storage.}]; \n at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:2503:28)\n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:2555:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1260:23)\n at Query.\u003canonymous\u003e (/var/user/node_modules/wx-server-sdk/index.js:1358:41)\n at step (/var/user/node_modules/tslib/tslib.js:133:27)\n at Object.next (/var/user/node_modules/tslib/tslib.js:114:57)\n at fulfilled (/var/user/node_modules/tslib/tslib.js:104:62)\n at \u003canonymous\u003e\n at process._tickCallback (internal/process/next_tick.js:188:7)"}
这两天我新建的云函数都有问题,后来直接复制以前的云函数改了改就好了,估计是模块什么的有变动导致出问题了
1、没看到全部代码,不好说,但是,不需要用到 await吗?
2、云函数调试需要打开云开发后台调试吧?
coding后自然知道
await也没卵用
是你不会用,不要轻易否定
呵呵,我已经解决了