DescribeCollection()
Addedv2.5.x
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  | 
|---|---|---|
  | Context for the current call to work.  | 
  | 
  | Optional parameters of the methods.  | |
  | Optional parameters for calling the methods.  | 
  | 
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 of the target collection.  | 
  | 
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)