本接口应在服务器端调用,详细说明参见服务端API。
数据库聚合
POST https://api.weixin.qq.com/tcb/databaseaggregate?access_token=ACCESS_TOKEN
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
access_token | string | 是 | 接口调用凭证 | |
env | string | 是 | 云环境ID | |
Query | string | 是 | 数据库操作语句 |
返回的 JSON 数据包
属性 | 类型 | 说明 |
---|---|---|
errcode | number | 错误码 |
errmsg | string | 错误信息 |
data | Array.<string> | 记录数组 |
errcode 的合法值
值 | 说明 | 最低版本 |
---|---|---|
0 | 请求成功 | |
-1 | 系统错误 | |
-1000 | 系统错误 | |
40014 | AccessToken 不合法 | |
40097 | 请求参数错误 | |
40101 | 缺少必填参数 | |
41001 | 缺少AccessToken | |
42001 | AccessToken过期 | |
43002 | HTTP METHOD 错误 | |
44002 | POST BODY 为空 | |
47001 | POST BODY 格式错误 | |
85088 | 该APP未开通云开发 | |
其他错误码 | 云开发错误码 |
{
"env":"test2-4a89da",
"query": "db.collection("test_collection").aggregate().match({tags:"cloud"}).limit(10).end()"
}
{
"errcode": 0,
"errmsg": "ok",
"data": [
"{"_id":"f77e039f-f1cf-4aa8-bd59-16cbaa91e6ea","location":{"type":"Point","coordinates":[{"$numberDouble":"113.0"},{"$numberDouble":"23.0"}]},"done":false,"description":"learn cloud database","due":"2019-09-09","tags":["cloud","database"]}",
"{"_id":"6bb88938-49ea-42b6-a6f5-ce408970cfc6","due":"2019-09-09","tags":["cloud","database"],"location":{"type":"Point","coordinates":[{"$numberDouble":"113.0"},{"$numberDouble":"23.0"}]},"done":false,"description":"学习 cloud database"}",
"{"_id":"51f4f67e-a6a1-4c3e-a50f-827380b8da86","description":"学习 cloud database","due":"2019-09-09","tags":["cloud","database"],"location":{"coordinates":[{"$numberDouble":"113.0"},{"$numberDouble":"23.0"}],"type":"Point"},"done":false}",
"{"_id":"ee1d69da-b7ec-4e7a-bc1f-2fae31da4ce0","tags":["cloud","database"],"location":{"type":"Point","coordinates":[{"$numberDouble":"113.0"},{"$numberDouble":"23.0"}]},"done":false,"description":"学习 cloud database","due":"2019-09-09"}"
]
}
数据库操作语句语法与数据库 API相同, 聚合操作参考聚合文档
微信支付从开发者工具 1.02.2005111 起,云控制台支持云开发微信支付商户绑定,在绑定完成后可在云开发中原生接入微信支付:免签...
错误码在使用云能力时跑出的异常(fail 回调 / Promise reject)Error对象中会带有errCode和errMsg,这里是errCode值的一览表。...
wx.reportPerformance(Number id, Number value, String|Array dimensions)基础库 2.9.2 开始支持,低版本需做兼容处理。小程序...
wx.arrayBufferToBase64(arrayBuffer) 基础库版本 1.1.0 开始支持,低版本需做兼容处理将 ArrayBuffer 数据转成 Base64 字符串示...
场景值基础库 1.1.0 开始支持,低版本需做兼容处理。场景值用来描述用户进入小程序的路径。完整场景值的含义请查看场景值列表。...