milvus-logo
LFAI
< Docs
  • RESTful

Describe Collection

POST
http://${MILVUS_URI}/v2/vectordb/collections/describe

Describes the details of a collection.

Example

export MILVUS_URI="localhost:19530"

curl --location --request POST "http://${MILVUS_URI}/v2/vectordb/collections/describe" \
--header "Content-Type: application/json" \
--data-raw '{
    "dbName": "default",
    "collectionName": "test_collection"
}'

Possible output would be similar to the following:

{
    "code": 200,
    "data": {
        "aliases": [],
        "autoId": false,
        "collectionID": 448707763883002014,
        "collectionName": "test_collection",
        "consistencyLevel": "Bounded",
        "description": "",
        "enableDynamicField": true,
        "fields": [
            {
                "autoId": false,
                "description": "",
                "id": 100,
                "name": "id",
                "partitionKey": false,
                "primaryKey": true,
                "type": "Int64"
            },
            {
                "autoId": false,
                "description": "",
                "id": 101,
                "name": "vector",
                "params": [
                    {
                        "key": "dim",
                        "value": "5"
                    }
                ],
                "partitionKey": false,
                "primaryKey": false,
                "type": "FloatVector"
            }
        ],
        "indexes": [
            {
                "fieldName": "vector",
                "indexName": "vector",
                "metricType": "COSINE"
            }
        ],
        "load": "LoadStateLoaded",
        "partitionsNum": 1,
        "properties": [],
        "shardsNum": 1
    }
}

Request

Parameters

  • Header parameters

    ParameterDescription
    Request-Timeoutinteger
    The timeout duration for this operation. Setting this to None indicates that this operation times out when any response returns or an error occurs.
    Authorizationstring
    The authentication token.
  • No query parameters required

  • No path parameters required

Request Body

{
    "dbName": "string",
    "collectionName": "string"
}
ParameterDescription
dbNamestring
The name of the database.
collectionName *string
The name of the collection to describe.

Response

Returns the specified collection in detail.

Response Bodies

  • Response body if we process your request successfully
{
    "code": "integer",
    "data": {
        "aliases": [
            {}
        ],
        "autoID": "boolean",
        "collectionID": "integer",
        "collectionName": "string",
        "consistencyLevel": "string",
        "description": "string",
        "enableDynamicField": "boolean",
        "fields": [
            {
                "autoId": "boolean",
                "description": "string",
                "id": "integer",
                "name": "string",
                "params": [
                    {
                        "key": "string",
                        "value": "string"
                    }
                ],
                "partitionKey": "boolean",
                "primaryKey": "boolean",
                "type": "string"
            }
        ],
        "indexes": [
            {
                "fieldName": "string",
                "indexName": "string",
                "metricType": "string"
            }
        ],
        "load": "string",
        "partitionNum": "integer",
        "properties": [
            {
                "key": "string",
                "value": "string"
            }
        ],
        "shardsNum": "integer"
    }
}
  • Response body if we failed to process your request
{
    "code": integer,
    "message": string
}

Properties

The properties in the returned response are listed in the following table.

PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 200: The request succeeds.
  • Others: Some error occurs.
dataobject
data[].aliasesarray
A list aliases assigned to the collection.
data[].aliases[]string
An alias of the collection.
data.autoIDboolean
Whether the primary key of this collection automatically increments.
data.collectionIDinteger
The ID assigned to the collection upon creation.
data.collectionNamestring
The name of the current collection.
data.consistencyLevelstring
The consistency level of the current collection.
data.descriptionstring
The description of the collection.
data.enableDynamicFieldboolean
Whether the reserved dynamic field named $meta is enabled to save non-schema-defined fields and their values in key-value pairs.
data[].fieldsarray
The collection fields in an array
data[].fields[]object
A field object.
data[].fields[].autoIdboolean
Whether this field automatically increments its value.
data[].fields[].descriptionstring
The description of the field.
data[].fields[].idinteger
The field ID.
data[].fields[].namestring
The name of the current field.
data[].fields[][].paramsarray
Other field parameters.
data[].fields[][].params[]object
A field parameter in a key-value pair
data[].fields[][].params[].keystring
Field parameter name.
data[].fields[][].params[].valuestring
Field parameter value.
data[].fields[].partitionKeyboolean
Whether this field serves as a partition key.
data[].fields[].primaryKeyboolean
Whether this field serves as the primary key.
data[].fields[].typestring
The data type of the field.
data[].indexesarray
The created indexes in an array
data[].indexes[]object
A index parameter object
data[].indexes[].fieldNamestring
The target field of this index.
data[].indexes[].indexNamestring
The name of this index.
data[].indexes[].metricTypestring
The metric type of this index.
data.loadstring
The load status of the current collection.
data.partitionNuminteger
The number of partitions in the collection.
data[].propertiesarray
Extra collection properties in an array.
data[].properties[]object
A collection property object in a key-value pair.
data[].properties[].keystring
The property name
data[].properties[].valuestring
The property value.
data.shardsNuminteger
The number of shards created along with the collection.
messagestring
Indicates the possible reason for the reported error.
Feedback

Was this page helpful?