微信小程序(八)-項目實例(原生框架 MINA轉雲開發)==02-雲開發數據庫

雲數據庫

雲數據庫開發文檔:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/database.html

1.新建雲數據庫(小程序中叫集合名,以前叫表名)

2.初始化:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/database/init.html

// 初始化雲數據庫
// 1.獲取當前雲環境下(env:"wcg-8gmhce8s0001d52f")的數據庫的引用
const DB = wx.cloud.database()
// 2.獲取集合(數據庫表名users)的引用
const users = DB.collection("users")
組件名.js

 

 

 

99.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章