Skip to main content

Database

A Database instance represents a database and its properties, returned by DescribeDatabase.

go
type Database struct {
Name string
Properties map[string]string
}

FIELDS:

  • Name (string) -

    The name of the database.

  • Properties (map[string]string) -

    The properties of the database.

Example​

Demonstrates Database usage.

go
import (
"context"

"github.com/milvus-io/milvus/client/v3/milvusclient"
)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{
Address: "YOUR_CLUSTER_ENDPOINT",
})
if err != nil {
// handle error
}
defer cli.Close(ctx)

databases, err := cli.ListDatabases(ctx, milvusclient.NewListDatabaseOption())
if err != nil {
// handle error
}
for _, db := range databases {
fmt.Println(db.Name)
}
Minimum SDK versionv3.0.x
Was this page helpful?