bjchy-udg-sdk 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ const { status, token } = await client.checkScanLogin(sessionId)
|
|
|
97
97
|
|
|
98
98
|
envId / mongoDatabase / AppSecret 由服务端从 `wxdb.config` 读取,客户端不传、不可传。
|
|
99
99
|
|
|
100
|
-
**同一 appid 多数据源**(一个 client、一份 token,用 `dbKey`
|
|
100
|
+
**同一 appid 多数据源**(一个 client、一份 token,用 `dbKey` 切换;管理后台里租户的 `bindings[]` 把 `dbKey` 路由到数据源注册中心里的某个数据源,详见 `docs/datasource-registry-and-schema-dictionary.md`;`dbKey` 路由思路的历史版本见 `docs/archive/multi-database-dbkey.md`):
|
|
101
101
|
|
|
102
102
|
```js
|
|
103
103
|
const client = udg.init({ endpoint, appid })
|
|
@@ -174,7 +174,7 @@ const { list } = await db.collection('orders').aggregate()
|
|
|
174
174
|
|
|
175
175
|
返回兼容微信云开发:`get → {data}`、`count → {total}`、`aggregate → {list}`、`add → {_id}/{ids}`、`update → {stats:{updated}}`、`remove → {stats:{removed}}`。
|
|
176
176
|
|
|
177
|
-
失败抛统一错误对象:`{ errorCode, errorMessage, requestId, timestamp }`(如 `UNSUPPORTED_OPERATOR`、`TENANT_NOT_FOUND`、`DB_NOT_FOUND`(dbKey
|
|
177
|
+
失败抛统一错误对象:`{ errorCode, errorMessage, requestId, timestamp }`(如 `UNSUPPORTED_OPERATOR`、`TENANT_NOT_FOUND`、`DB_NOT_FOUND`(dbKey 未在租户 bindings[] 中登记)、`READONLY_DATABASE`(对只读 dbKey 执行了写操作)、`FORBIDDEN`(Token 无效/过期,会自动 refresh 重试)、`TIMEOUT`)。
|
|
178
178
|
|
|
179
179
|
## 说明
|
|
180
180
|
|