milvus-logo
LFAI
< Docs
  • Go

ListCollections()

This method lists all collections in the connected Milvus instance.

Invocation

client.ListCollections(ctx)

Parameters

ParameterDescriptionType
ctxContext to control API invocation processcontext.Context

Return

A array of entity.Collection that represents the collections in the Milvus instance.

Errors

err: error in the listing process (if any). Possible errors are listed below:

  • ErrClientNotReady: error that the client is not connected.

  • Error that API invocation failed.

Example

listColl, err := milvusClient.ListCollections(
  context.Background(),
)
if err != nil {
  log.Fatal("failed to list all collections:", err.Error())
}
log.Println(listColl)
Feedback

Was this page helpful?