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

Milvus
Zilliz
< Docs
  • Go

ListCollections()

This method lists all existing collections.

func (c *Client) ListCollections(ctx context.Context, option ListCollectionOption, callOptions ...grpc.CallOption) (collectionNames []string, err error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

ListAliasesOption

callOpts

Optional parameters for calling the methods.

grpc.CallOption

ListCollectionOption

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

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

NewListCollectionOption

The signature of this method is as follows:

func NewListCollectionOption() *listCollectionOption

Return

[]string

Example

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

collectionNames, err := cli.ListCollections(ctx, milvusclient.NewListCollectionOption())
if err != nil {
       // handle error
}

fmt.Println(collectionNames)

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?