跳到主要内容

DropCollection()

This method drops the specified collection and the entities within.

func (c *GrpcClient) DropCollection(ctx context.Context, collName string) error

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

collName

Name of the collection to drop.

string

Return

Null

Errors

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

  • ErrClientNotReady: The client is not connected to Milvus.

  • ErrCollectionNotExists: The collection with the specified name does not exist.

  • The call to this API fails.

Example

// drop collection
errDrop := mc.DropCollection(context.Background(), collectionName)
if errDrop != nil {
log.Fatal("failed to drop collection:", errDrop.Error())
}