May 20, 2021 WeChat Mini Program Development Document
Gets a reference to the collection
The method signature is as follows:
function collection(name: string): Collection
The method accepts a name parameter that specifies the name of the collection to be referenced
The sample code
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
const todosCollection = db.collection('todos')