收藏
回答

怎么获取所有集合?

请问云开发使用云函数有办法获取数据库所有集合名称吗?

回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2021-06-12

    https://docs.cloudbase.net/api-reference/manager/node/function.html#getfunctionlist

    2021-06-12
    有用
    回复 11
    • 4520
      4520
      2021-06-12
      获取集合名称失败 Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID e2719842-cb47-11eb-a166-5254000ead67, cloud function service error code -504002, error message ReferenceError: CloudBase is not defined
          at Runtime.exports.main [as handler] (:22603/var/user/index.js:14)
          at Runtime.handleOnce (:22603/var/runtime/node10/Runtime.engine.js:216)
          at Timeout.setTimeout [as _onTimeout] (:22603/var/runtime/node10/Runtime.engine.js:54)
          at ontimeout (:22603/appservice/timers.js:436)
          at tryOnTimeout (:22603/appservice/timers.js:300)
          at listOnTimeout (:22603/appservice/timers.js:263)
          at Timer.processTimers (:22603/appservice/timers.js:223); at cloud.callFunction api; 
          at new g (VM69 WAService.js:2)
          at c (VM69 WAService.js:2)
          at I (VM69 WAService.js:2)
          at Function.success (VM69 WAService.js:2)
          at C (VM69 WAService.js:2)
          at VM69 WAService.js:2
          at u (VM69 WAService.js:2)
          at Function.<anonymous> (VM69 WAService.js:2)
          at C (VM69 WAService.js:2)
          at VM69 WAService.js:2
      这是什么错误呢?
      2021-06-12
      回复
    • Mr.Zhao
      Mr.Zhao
      2021-06-12回复4520
      CloudBase is not defined
      2021-06-12
      回复
    • 4520
      4520
      2021-06-12
      这个怎么解决呢?我百度说npm install --save wx-server-sdk,我试了也是报同样的错,您好请问怎么解决呢?
      2021-06-12
      回复
    • Mr.Zhao
      Mr.Zhao
      2021-06-12回复4520
      好好看看文档,别心急,不是wx-server-sdk
      2021-06-12
      回复
    • 4520
      4520
      2021-06-12
      大佬,没报刚在那个错误了,变成 Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID ff0ddf46-cb4c-11eb-8dcd-525400a255c0, cloud function service error code -504002, error message Runtime.UserCodeSyntaxError: SyntaxError: Unexpected identifier
          at Object.module.exports.load (:22603/var/runtime/node10/UserFunction.js:33)
          at Runtime.handleOnce (:22603/var/runtime/node10/Runtime.engine.js:97)
          at Timeout.setTimeout [as _onTimeout] (:22603/var/runtime/node10/Runtime.engine.js:54)
          at ontimeout (:22603/appservice/timers.js:436)
          at tryOnTimeout (:22603/appservice/timers.js:300)
          at listOnTimeout (:22603/appservice/timers.js:263)
          at Timer.processTimers (:22603/appservice/timers.js:223); at cloud.callFunction api; 
          at new g (VM224 WAService.js:2)
          at c (VM224 WAService.js:2)
          at I (VM224 WAService.js:2)
          at Function.success (VM224 WAService.js:2)
          at C (VM224 WAService.js:2)
          at VM224 WAService.js:2
          at u (VM224 WAService.js:2)
          at Function.<anonymous> (VM224 WAService.js:2)
          at C (VM224 WAService.js:2)
          at VM224 WAService.js:2
      SyntaxError: Unexpected identifier 这个又该怎么解决呢?
      2021-06-12
      回复
    查看更多(6)
登录 后发表内容