天天看点

微信小程序云开发基础学习

**

微信小程序云开发基础学习

**

  1. 鼠标右键点击 cloudfunctions 新建Node.js云函数
    微信小程序云开发基础学习
  2. 打开新建的云函数下 index.js
const db = cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
  return await db.collection("article_class").get()
  
}
           
微信小程序云开发基础学习

article_class 是我创建的数据库集合名称

微信小程序云开发基础学习

获取数据

微信小程序云开发基础学习