Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Small Program Cloud Development API gets a reference to the collection


May 20, 2021 WeChat Mini Program Development Document


Table of contents


db.collection

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 db = wx.cloud.database()
const todosCollection = db.collection('todos')