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 |
---|---|---|
|
Context for the current call to work. |
|
|
Name of the collection to describe. |
|
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)