Skip to content
MilvusNode SDK
Sections

Describe collection

Markdown

Copy for agent

Connection and CORS help

Use HTTPS for remote clusters or HTTP on loopback. Requests go directly from your browser to the endpoint. Run List collections to populate the collection selector. When copying an authenticated cURL command, set MILVUS_TOKEN in your shell.

For cross-origin requests, configure the endpoint to answer OPTIONS and allow the docs origin, POST, Content-Type, and Authorization if you use a token. Try the copied cURL command to troubleshoot outside the browser.

POST/v2/vectordb/collections/describe

{
  "dbName": "default",
  "collectionName": "books"
}

Example response

{
  "code": 0,
  "data": {
    "collectionName": "books",
    "collectionID": 123456789,
    "description": "Book catalog",
    "autoId": false,
    "fields": [
      {
        "description": "",
        "primaryKey": true,
        "partitionKey": false,
        "clusteringKey": false,
        "autoId": false,
        "nullable": false,
        "id": 100,
        "name": "id",
        "type": "Int64"
      },
      {
        "description": "",
        "primaryKey": false,
        "partitionKey": false,
        "clusteringKey": false,
        "autoId": false,
        "nullable": false,
        "id": 101,
        "name": "title",
        "type": "VarChar",
        "params": [
          {
            "key": "max_length",
            "value": "256"
          }
        ]
      },
      {
        "description": "",
        "primaryKey": false,
        "partitionKey": false,
        "clusteringKey": false,
        "autoId": false,
        "nullable": false,
        "id": 102,
        "name": "vector",
        "type": "FloatVector",
        "params": [
          {
            "key": "dim",
            "value": "4"
          }
        ]
      }
    ],
    "structFields": [],
    "functions": [],
    "aliases": [
      "current_books"
    ],
    "indexes": [
      {
        "fieldName": "vector",
        "indexName": "vector_idx",
        "metricType": "COSINE"
      }
    ],
    "load": "LoadStateLoaded",
    "shardsNum": 1,
    "partitionsNum": 2,
    "consistencyLevel": "Bounded",
    "enableDynamicField": false,
    "externalSource": "",
    "externalSpec": "",
    "properties": []
  },
  "message": ""
}
cURL command
curl --request POST --url 'https://your-cluster.example.com/v2/vectordb/collections/describe' \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer ${MILVUS_TOKEN}" \
  --data-raw '{
  "dbName": "default",
  "collectionName": "books"
}'

Read field names, data types, indexes and load state for a collection.

A successful response makes its schema available in Query and Search.

Request fields

dbName string
Database name. Operations on collections use default when omitted.
collectionName string (required)
Name of the collection.

See HttpClient.describeCollection for the Node.js SDK method.