May 20, 2021 WeChat Mini Program Development Document
Support: small programs, cloud functions, web
Gets a reference to the collection. The method accepts a name parameter that specifies the name of the collection to be referenced.
The name of the collection
const db = wx.cloud.database()
const todosCollection = db.collection('todos')
const cloud = require('wx-server-sdk')
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
})
const db = cloud.database()
const todosCollection = db.collection('todos')