新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)小程序教程:微信小程序云開發(fā)API數(shù)據(jù)庫·導(dǎo)出
databaseMigrateExport
本接口應(yīng)在服務(wù)器端調(diào)用,詳細(xì)說明參見服務(wù)端API。
數(shù)據(jù)庫導(dǎo)出
請求地址
POST https://api.weixin.qq.com/tcb/databasemigrateexport?access_token=ACCESS_TOKEN
請求參數(shù)
| 屬性 | 類型 | 默認(rèn)值 | 必填 | 說明 |
|---|---|---|---|---|
| access_token | string | 是 | 接口調(diào)用憑證 | |
| env | string | 是 | 云環(huán)境ID | |
| file_path | string | 是 | 導(dǎo)出文件路徑(文件會導(dǎo)出到同環(huán)境的云存儲中,可使用獲取下載鏈接 API 獲取下載鏈接) | |
| file_type | number | 是 | 導(dǎo)出文件類型,文件格式參考數(shù)據(jù)庫導(dǎo)入指引中的文件格式部分 | |
| query | string | 是 | 導(dǎo)出條件 |
file_type 的合法值
| 值 | 說明 | 最低版本 |
|---|---|---|
| 1 | JSON | |
| 2 | CSV |
返回值
Object
返回的 JSON 數(shù)據(jù)包
| 屬性 | 類型 | 說明 |
|---|---|---|
| errcode | number | 錯誤碼 |
| errmsg | string | 錯誤信息 |
| job_id | number | 導(dǎo)出任務(wù)ID,使用數(shù)據(jù)庫遷移進度查詢 API 查詢導(dǎo)出結(jié)果,獲取文件下載鏈接。 |
errcode 的合法值
| 值 | 說明 | 最低版本 |
|---|---|---|
| 0 | 請求成功 | |
| -1 | 系統(tǒng)錯誤 | |
| -1000 | 系統(tǒng)錯誤 | |
| 40014 | AccessToken 不合法 | |
| 40097 | 請求參數(shù)錯誤 | |
| 40101 | 缺少必填參數(shù) | |
| 41001 | 缺少AccessToken | |
| 42001 | AccessToken過期 | |
| 43002 | HTTP METHOD 錯誤 | |
| 44002 | POST BODY 為空 | |
| 47001 | POST BODY 格式錯誤 | |
| 85088 | 該APP未開通云開發(fā) | |
| 其他錯誤碼 | 云開發(fā)錯誤碼 |
請求數(shù)據(jù)示例
{
"env":"test2-4a89da",
"file_path":"test_export",
"file_type":1,
"query":"const Point = db.Geo.Point;db.collection(\'geo\').where({name: \'x\',age: _.gt(10).and(_.lt(20)),loc: new Point(113,23),array: [1,2]}).limit(10).skip(1).orderBy(\'age\',\'asc\').orderBy(\'name\', \'desc\').field({ name: true }).get()"
}
返回數(shù)據(jù)示例
{
"errcode": 0,
"errmsg": "ok",
"job_id": 100074947
}
導(dǎo)出條件說明
查詢語句語法與數(shù)據(jù)庫 API相同
分享文章:創(chuàng)新互聯(lián)小程序教程:微信小程序云開發(fā)API數(shù)據(jù)庫·導(dǎo)出
文章轉(zhuǎn)載:http://fisionsoft.com.cn/article/dhidigi.html


咨詢
建站咨詢

