Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Small Program Cloud Development API Database - Get Collection Information


May 20, 2021 WeChat Mini Program Development Document



databaseCollectionGet

This interface should be called on the server side, as detailed in the service side API.

Get collection information in a specific cloud environment

The request address

POST https://api.weixin.qq.com/tcb/databasecollectionget?access_token=ACCESS_TOKEN

Request parameters

Property Type The default Required Description
access_token string Is The interface calls the credentials
Env string Is Cloud environment ID
limit number 10 Whether Get a limit on the number of people
offset number 0 Whether Offset

Returns a value

Object

The returned JSON packet

Property Type Description
errcode number Error code
errmsg string The error message
pager Object Peddle information
collections Array.<Object> Collection information

The legal value of errcode

Value Description The lowest version
0 The request was successful
-1 System error
-1000 System error
40014 AccessToken is illegal
40097 The request parameter is wrong
40101 Required parameters are missing
41001 Missing AccessToken
42001 AccessToken expires
43002 HTTP METHOD error
44002 POST BODY is empty
47001 POST BODY format is incorrect
85088 The APP is not open for cloud development
Other error codes Cloud development error code

The structure of the pager

Property Type Description
Offset number Offset
Limit number Single query limit
Total number The total number of records that meet the query criteria

The structure of the collections

Property Type Description
name string The name of the collection
count number Table Chinese number of files
size number The size of the table (that is, Chinese the total size of the table, in bytes).
index_count number The number of indexes
index_size number Index occupies size in bytes

An example of requesting data

{
  "env":"test2-4a89da",
  "limit": 10,
  "offset": 0
}

Return an example of the data

{
  "errcode": 0,
  "errmsg": "ok",
  "collections": [
      {
          "name": "geo",
          "count": 13,
          "size": 2469,
          "index_count": 1,
          "index_size": 36864
      },
      {
          "name": "test_collection",
          "count": 1,
          "size": 67,
          "index_count": 1,
          "index_size": 16384
      }
  ],
  "pager": {
      "Offset": 0,
      "Limit": 10,
      "Total": 2
  }
}