# [Collection](/minigame/dev/wxcloud/reference-sdk-api/database/Collection).doc(id: string): [Document](/minigame/dev/wxcloud/reference-sdk-api/database/Document)

> 支持端：[小程序](/miniprogram/dev/framework/client-lib/version.md), [云函数](/minigame/dev/wxcloud/reference/changelog-server-sdk), [Web](/minigame/dev/wxcloud/reference/changelog-web-sdk)

获取集合中指定记录的引用。方法接受一个 id 参数，指定需引用的记录的 _id。

## 参数

### id: string

记录 _id

## 返回值

### [Document](/minigame/dev/wxcloud/reference-sdk-api/database/Document)

## 示例代码

```js
const myTodo = db.collection('todos').doc('my-todo-id')
```
