describeCollection()

This operation lists detailed information about a specific collection.

await milvusClient.describeCollection(data)

Request Syntax

await milvusClient.describeCollection({ 
    db_name: string,
    collection_name: string 
})

PARAMETERS:

  • db_name (string) -

    The name of the database that holds the target collection.

  • collection_name (string) -

    [REQUIRED]

    The name of an existing collection.

  • timeout (number)

    The timeout duration for this operation.

    Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.

RETURNS Promise

This method returns a promise that resolves to a DescribeCollectionResponse object.

{
    schema: CollectionSchema,
    collectionID: string,
    collection_name: string,
    consistency_level: string,
    aliases: string[],
    properties: KeyValuePair[],
    created_timestamp: string,
    created_utc_timestamp: string,
    shards_num: number,
    num_partitions: string,
    db_name: string,
    functions: FunctionObject[],
    external_source?: string,
    external_spec?: string,
    do_physical_backfill?: boolean,
    file_resource_ids?: string[],
    update_timestamp_str: string,
    update_timestamp: number,
    anns_fields: Record<string, FieldSchema>,
    scalar_fields: Record<string, FieldSchema>,
    function_fields: Record<string, FieldSchema>,
    status:  ResStatus
}

PARAMETERS:

  • schema (CollectionSchema) - The schema of the collection.

    • name (string) -

      The collection name.

    • description (string) -

      An optional description of the collection.

    • enable_dynamic_field (boolean) -

      Whether the dynamic field is enabled. When true, fields not declared in the schema are stored in a hidden $meta JSON field.

    • autoID (boolean) -

      Whether the primary key is automatically generated by Milvus.

    • fields (FieldSchema[]) -

      All scalar and vector fields declared on the collection. For the full FieldSchema field reference, refer to the FieldSchema class doc.

    • functions (FunctionObject[]) -

      Doc-in / doc-out functions attached to the collection (for example, the BM25 sparse-vector function).

  • collectionID (string) - The internal collection ID assigned by Milvus.

  • collection_name (string) - The collection name.

  • consistency_level (string) - The default consistency level for queries against this collection. Possible values are Strong, Session, Bounded, Eventually, and Customized.

  • aliases (string[]) - A list of aliases that point to this collection.

  • properties (KeyValuePair[]) - Collection-level properties (for example, mmap.enabled, collection.ttl.seconds) declared at creation or set via alterCollectionProperties().

  • created_timestamp (string) - The hybrid timestamp at which the collection was created.

  • created_utc_timestamp (string) - The UTC timestamp, in milliseconds, at which the collection was created.

  • shards_num (number) - The number of shards configured on the collection.

  • num_partitions (string) - The number of partitions configured on the collection. This value is meaningful only when a partition key field is declared.

  • db_name (string) - The database that owns this collection.

  • functions (FunctionObject[]) - A flattened list of doc-in / doc-out functions attached to the collection.

  • external_source (string) -

    The external source path. Optional.

  • external_spec (string) -

    The external spec configuration. Optional.

  • do_physical_backfill (boolean) -

    Whether to physically backfill external data. Optional.

  • file_resource_ids (Array) -

    The external file resource IDs. Optional.

  • update_timestamp_str (string) - The hybrid timestamp at which the collection was last updated, formatted as a string.

  • update_timestamp (number) - The numeric form of the last-update timestamp.

  • anns_fields (Record) - A mapping from vector-field name to its FieldSchema, covering all vector fields declared on the collection.

  • scalar_fields (Record) - A mapping from scalar-field name to its FieldSchema, covering all scalar fields declared on the collection.

  • function_fields (Record) - A mapping from function-output-field name to its FieldSchema.

  • ResStatus A ResStatus object.

    • code (number) -

      A code that indicates the operation result. It remains 0 if this operation succeeds.

    • error_code (string | number) -

      An error code that indicates an occurred error. It remains Success if this operation succeeds.

    • reason (string) -

      The reason that indicates the reason for the reported error. It remains an empty string if this operation succeeds.

Example

const milvusClient = new MilvusClient({
    address: 'localhost:19530',
    token: 'root:Milvus',
});
 const res = await milvusClient.describeCollection({ collection_name: 'my_collection' });

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?