Collection.doc
2020-08-28 15:19 更新
获取集合内对应 ID 的文档对象
参数
| 名称 | 类型 | 必须 | 说明 |
|---|---|---|---|
| id | String | 是 | 文档 ID |
返回值:Document
代码示例
const cloud = require('swan-server-sdk')
exports.main = async (event, context) => {
cloud.init(context)
const db = cloud.database()
const doc = db.collection('articles').doc('some-doc-id')
}
以上内容是否对您有帮助:

免费 AI IDE


更多建议: