const cloud = require('wx-server-sdk')
cloud.init();
// 云函数入口函数
exports.main = async (event, context) => {
const wxContext = cloud.getWXContext();
//console.log(cloud);
const db = cloud.database()
const recruit= await db.collection('recruit_school').limit(10).get();
console.log(recruit);
return {
event
}
}
appId:wx2e35d90edf748699
云环境:gkzy-k8bhr
具体报错信息是什么?
node.js:1 [error] 函数执行失败(耗时 120ms) 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 Object.returnAsCloudSDKError (F:\WeChatProjects\gkzy\cloudfunctions\query\node_modules\wx-server-sdk\index.js:6027:16)
at Object.checkError (F:\WeChatProjects\gkzy\cloudfunctions\query\node_modules\wx-server-sdk\index.js:1359:23)
at F:\WeChatProjects\gkzy\cloudfunctions\query\node_modules\wx-server-sdk\index.js:1425:33
at processTicksAndRejections (internal/process/task_queues.js:85:5)