🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
< Docs
  • Go

Delete()

This method deletes data from a specific collection.

func (c *Client) Delete(ctx context.Context, option DeleteOption, callOptions ...grpc.CallOption) (DeleteResult, error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

DeleteOption

callOptions

Optional parameters for calling the methods.

grpc.CallOption

DeleteOption

This is an interface type. The deleteOption struct types implement this interface type.

You can use the NewDeleteOption function to get the concrete implementation.

NewDeleteOption

The signature of this method is as follows:

func NewDeleteOption(collectionName string) *deleteOption

Parameter

Description

Type

collectionName

Name of the target collection.

string

DeleteResult

The DeleteResult struct type is as follows:

type DeleteResult struct {
    DeleteCount int64
}

Return

DeleteResult

Example

res, err := cli.Delete(ctx, milvusclient.NewDeleteOption("quick_setup").
    WithInt64IDs("id", []int64{1, 2, 3}))
if err != nil {
    // handle error
}

fmt.Println(res.DeleteCount)

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?