- 获取数据项详情
- 操作步骤
- 示例
获取数据项详情
操作步骤
1.通过 tableID 实例化一个 TableObject 对象,操作该对象即相当于操作对应的数据表
let MyTableObject = new BaaS.TableObject(tableID)
参数说明
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| tableID | Number | 是 | 数据表 ID |
2.指定 recordID 执行获取相应数据项操作
MyTableObject.get(recordID)
参数说明
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| recordID | String | 是 | 记录 ID |
示例
请求示例
let tableID = 10let recordID = '59897882ff650c0477f00485'let Product = new BaaS.TableObject(tableID)Product.get(recordID).then(res => {// success}, err => {// err})
返回示例 (res.statusCode === 200)
res.data:
{"_id": "59a3c2b5afb7766a5ec6e84e","amount": 0,"created_at": 1503904437,"created_by": 36395395,"desc": ["good"],"id": "59a3c2b5afb7766a5ec6e84e","name": "apple","price": 1.0,"read_perm": ["user:*"],"updated_at": 1503904437,"write_perm": ["user:*"]}
