milvus-logo
Star
0
Forks
0
Get Started

DropCollection()

This method drops the specified collection and the entities within.

Invocation

client.DropCollection(ctx, collName)

Parameters

ParameterDescriptionType
ctxContext to control API invocation processcontext.Context
collNameName of the collection to dropString

Return

No return.

Errors

err: error in the dropping process (if any), possible errors are listed below:

  • ErrClientNotReady, error that the client is not connected.

  • ErrCollectionNotExists, error that the collection with the specified name does not exist.

  • error that API invocation failed.

Example

err = milvusClient.DropCollection(
  context.Background(),
  "book",
)
if err != nil {
    log.Fatal("fail to drop collection:", err.Error())
}