🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
< Docs
  • Go

DescribeCollection()

This method describes a collection by providing its detailed information.

func (c *Client) DescribeCollection(ctx context.Context, option DescribeCollectionOption, callOptions ...grpc.CallOption) (collection *entity.Collection, err error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

DescribeCollectionOption

callOpts

Optional parameters for calling the methods.

grpc.CallOption

DescribeCollectionOption

This is an interface type. The describeCollectionOption struct type implements this interface type.

You can use the NewDescribeCollectionOption() function to get the concrete implementation.

NewDescribeCollectionOption

The signature of this method is as follows:

func NewDescribeCollectionOption(name string) *describeCollectionOption

Parameter

Description

Type

name

Name of the target collection.

string

entity.Collection

The entity.Alias struct type is as follows:

type Collection struct {
    ID               int64           // collection id
    Name             string          // collection name
    Schema           *entity.Schema  // collection schema, with fields schema and primary key definition
    PhysicalChannels []string
    VirtualChannels  []string
    Loaded           bool
    ConsistencyLevel entity.ConsistencyLevel
    ShardNum         int32
    Properties       map[string]string
}

entity.Schema

For details about this struct type, refer to entity.Schema.

entity.ConsistencyLevel

For details about this enumeration, refer to entity.ConsistencyLevel.

Return

*entity.Collection

Example

import (
        "context"
        "github.com/milvus-io/milvus/client/v2/milvusclient"
)

collection, err := cli.DescribeCollection(ctx, milvusclient.NewDescribeCollectionOption("quick_setup"))
if err != nil {
        // handle error
}

fmt.Println(collection)

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?