milvus-logo
LFAI
< Docs
  • Go

DescribeCollection()

This method returns the details of a specific collection.

func (c *GrpcClient) DescribeCollection(ctx context.Context, collName string) (*entity.Collection, error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

collName

Name of the collection to describe.

string

Return

An entity.Collection struct.

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

Errors

Any error in the execution of the request. Possible errors are as follows:

Example

// describe collection
collection, errDesc := mc.DescribeCollection(context.Background(), collectionName)
if errDesc != nil {
   log.Fatal("failed to describe collection:", errDesc.Error())
}
log.Printf("collection: %v", collection)

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?