# databaseCollectionGet

Call this API at the server side. For more information, see Server API.

Gets collection information in a specific cloud environment.

# Request Address

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

# Request Parameters

Attribute Type Default Required Description
access_token string Yes Credentials to call API
env string Yes Cloud environment ID
limit number 10 No Maximum number of collections whose information is required
offset number 0 No Offset

# Return Value

# Object

JSON data package that is returned

Attribute Type Description
errcode number Error code
errmsg string Error message
pager Object Information per page
collections Array.<Object> Collection information

Valid values of errcode

Value Description Minimum Version
0 Request successful
-1 System Error
-1000 System Error
40014 Invalid AccessToken
40097 Invalid request parameter
40101 Required parameter missing
41001 AccessToken missing
42001 AccessToken expired
43002 HTTP METHOD error
44002 Empty POST BODY
47001 Incorrect format of POST BODY
85088 Cloud Base is not enabled on this App
Other error codes Cloud Base error codes

Structure of pager

Attribute Type Description
Offset number Offset
Limit number Single query limit
Total number Number of records that meet the query condition

Structure of collections

Attribute Type Description
name string Collection name
count number Number of documents in the table
size number Size of the table (i.e. the total size of the documents in the table), in bytes
index_count number Number of indexes
index_size number Size of indexes, in bytes

# Request Data Example

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

# Return Data Example

{
  "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
  }
}