This method lists all collections in the connected Milvus instance.
client.ListCollections(ctx)
Parameter | Description | Type |
---|---|---|
ctx | Context to control API invocation process | context.Context |
A array of entity.Collection that represents the collections in the Milvus instance.
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.
listColl, err := milvusClient.ListCollections(
context.Background(),
)
if err != nil {
log.Fatal("failed to list all collections:", err.Error())
}
log.Println(listColl)