请问完成去重代码后,云端测试云函数执行失败
来源:3-12 突破获取数据条数的限制
yZw丶先生
2020-08-01
报错{“errorCode”:1,“errorMessage”:“user code exception caught”,“stackTrace”:“errCode: -502005 database collection not exists | errMsg: [ResourceNotFound] Db or Table not exist. Please check your request, but if the problem cannot be solved, contact us.; \nError: errCode: -502005 database collection not exists | errMsg: [ResourceNotFound] Db or Table not exist. Please check your request, but if the problem cannot be solved, contact us.; \n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6187:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1364:23)\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1499:33)\n at \u003canonymous\u003e\n at process._tickCallback (internal/process/next_tick.js:188:7)”}
1回答
-
错误信息是集合不存在:
1、需要手动在云数据库中创建相应集合
2、在云函数中初始化云环境:
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV})
012020-08-01
相似问题