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

Milvus
Zilliz
< Docs
  • Go

HasPartition()

This method checks whether the specified partition exists.

func (c *Client) HasPartition(ctx context.Context, opt HasPartitionOption, callOptions ...grpc.CallOption) (has bool, err error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

HasPartitionOption

callOpts

Optional parameters for calling the methods.

grpc.CallOption

HasPartitionOption

This is an interface type. The hasPartitionOption struct type implements this interface type.

You can use the NewHasPartitionOption() function to get the concrete implementation.

NewHasCollectionOption

The signature of this method is as follows:

func NewHasCollectionOption(name string) HasCollectionOption

Parameter

Description

Type

name

Name of the collection to check.

string

Return

bool

Example

import (
        "context"
        "github.com/milvus-io/milvus/client/v2/milvusclient"
)

result, err := cli.HasPartition(ctx, milvusclient.NewHasPartitionOption("quick_setup", "partitionA"))
if err != nil {
    // handle error
}

fmt.Println(result)

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?