databaseCollectionGet

View Markdown

Last edited on 2026-07-05

This API should be called on the server side. For detailed instructions, see Server-side API.

Retrieves collection information in a specific cloud environment.

Request URL

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

Request Parameters

Attribute Type Default Required Description
access_token / cloudbase_access_token string Yes API Call Credential
env string Yes Cloud Environment ID
limit number 10 No Limit on the number of items to retrieve
offset number 0 No Offset

Return Value

Object

The returned JSON data package

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

Valid values for errcode

Value Description Minimum Version
0 Request successful
-1 System error
-1000 System error
40014 Invalid AccessToken
40097 Invalid request parameters
40101 Missing required parameters
41001 Missing AccessToken
42001 AccessToken expired
43002 HTTP METHOD error
44002 POST BODY is empty
47001 Invalid POST BODY format
85088 Cloud Development is not enabled for this App
Other error codes Cloud Development Error Codes

Structure of pager

Attribute Type Description
Offset number Offset
Limit number Limit per query
Total number Total number of records matching the query conditions

Structure of collections

Attribute Type Description
name string Collection name
count number Number of documents in the collection
size number Size of the collection (total size of documents), unit: bytes
index_count number Number of indexes
index_size number Size occupied by indexes, unit: 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
  }
}