总是提示:database collection not exists ,但是环境下确实有这个表呀?
发布于 6 年前 作者 rengang 2554 次浏览 来自 问答

3 回复

db.collection(‘add’)

callFunction 是调用云函数。collection是查找到集合(也就是表名)你的表名叫userInfo。那么你云函数add里面的index.js里这样写,写完后部署下云函数,至于调用就你的那样操作就好了。

// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
   return await cloud.database().collection('userInfo').get()
}
回到顶部