在3-11这一节,云数据库中已经有从第三方服务器申请的数据了,但是无法使用云函数调用用数据?

来源:3-10 优化接口请求方式及数据批量插入

teeo

2023-05-05

VM942 WAService.js:2 Uncaught (in promise) thirdScriptError
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.
Error: 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.
at new c (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:233813)
at Function.success (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:257166)
at Object.success (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:127910)
at g (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:557606)
at b (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:557844)
at http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:559398
at http://127.0.0.1:26613/appservice/dev/asdebug.js:10:42311
at T (http://127.0.0.1:26613/appservice/dev/asdebug.js:10:41961)
at http://127.0.0.1:26613/appservice/dev/asdebug.js:1:3645
at Set.forEach ()(env: Windows,mp,1.06.2301160; lib: 2.10.4)
errorReport @ VM942 WAService.js:2
thirdErrorReport @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
c @ VM942 WAService.js:2
i @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
value @ VM942 WAService.js:2
t @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
VM942 WAService.js:2 Uncaught (in promise) thirdScriptError
errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID b88e9f0b-112e-4605-8ec5-5ad317997ceb, cloud function service error code -501000, error message FunctionName parameter could not be found.; at cloud.callFunction api;
Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID b88e9f0b-112e-4605-8ec5-5ad317997ceb, cloud function service error code -501000, error message FunctionName parameter could not be found.; at cloud.callFunction api;
at new c (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:233813)
at l (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:234320)
at d (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:234411)
at Function.success (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:391951)
at http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:127910
at A (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:560349)
at i. (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:943613)
at i.emit (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:620360)
at Za (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:944474)
at http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:945717(env: Windows,mp,1.06.2301160; lib: 2.10.4)
errorReport @ VM942 WAService.js:2
thirdErrorReport @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
c @ VM942 WAService.js:2
i @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
value @ VM942 WAService.js:2
t @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
VM942 WAService.js:2 Uncaught (in promise) thirdScriptError
errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID ec1e71cf-680e-4fc5-a6e1-291d71160cff, cloud function service error code -501000, error message FunctionName parameter could not be found.; at cloud.callFunction api;
Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID ec1e71cf-680e-4fc5-a6e1-291d71160cff, cloud function service error code -501000, error message FunctionName parameter could not be found.; at cloud.callFunction api;
at new c (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:233813)
at l (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:234320)
at d (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:234411)
at Function.success (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:391951)
at http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:127910
at A (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:560349)
at i. (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:943613)
at i.emit (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:620360)
at Za (http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:944474)
at http://127.0.0.1:26613/appservice/dev/WAService.js?t=wechat&s=1683271137752&v=2.10.4:2:945717(env: Windows,mp,1.06.2301160; lib: 2.10.4)
errorReport @ VM942 WAService.js:2
thirdErrorReport @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
c @ VM942 WAService.js:2
i @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2
value @ VM942 WAService.js:2
t @ VM942 WAService.js:2
(anonymous) @ VM942 WAService.js:2

写回答

2回答

谢成

2023-05-06

在云函数中设置云环境id:

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV})


0
0

谢成

2023-05-06

//img.mukewang.com/szimg/6455e7c30915d6c517200602.jpg

错误信息的意思是集合不存在,需要手动在云数据库中创建集合,然后再使用。

0
1
teeo
老师,已经有集合了,并且已经从api获取了数据并写进云数据库,云函数同样找不到,我看到网上有一个帖子是小程序是没有在云函数那里引入环境,不知道是不是这样
2023-05-06
共1条回复

微信小程序云开发-从0打造云音乐全栈小程序

横跨小程序端、云后端、CMS一站式云开发的小程序全栈课程

1938 学习 · 2768 问题

查看课程