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

The SDK database Collection gets a reference


May 20, 2021 WeChat Mini Program Development Document


Table of contents


Collection.doc(id: string): Document

Support: small programs, cloud functions, web

Gets a reference to the specified record in the collection. The method accepts an id parameter that specifies the value of the record to _id.

Parameters

id: string

Record _id

Returns a value

Document

The sample code

const myTodo = db.collection('todos').doc('my-todo-id')