ListDatabasesAsync()

Lists all databases.

public async Task<ListDatabasesResp> ListDatabasesAsync(ListDatabasesReq request, CancellationToken cancellationToken = default)

Request Syntax

var request = new ListDatabasesReq();

ListDatabasesResp response = await client.ListDatabasesAsync(request);

REQUEST PARAMETERS:

ListDatabasesReq has no parameters.

RETURN TYPE:

Task

RETURNS:

A ListDatabasesResp object that contains the list of databases in the cluster.

ListDatabasesResp
    DatabaseNames      // -> IReadOnlyList<string>
    CreatedTimestamps  // -> IReadOnlyList<ulong>
    DatabaseIds        // -> IReadOnlyList<long>

PARAMETERS:

  • DatabaseNames (IReadOnlyList) -

    The names of the databases in the cluster.

  • CreatedTimestamps (IReadOnlyList) -

    The hybrid timestamps at which the databases were created, aligned with DatabaseNames.

  • DatabaseIds (IReadOnlyList) -

    The ids of the databases, aligned with DatabaseNames.

EXCEPTIONS:

  • MilvusException

    Thrown when the RPC fails or the server returns an error. Inspect the exception message for details.

Example

using Milvus.Client.V2;
using Milvus.Client.V2.Requests.Database;
using Milvus.Client.V2.Responses.Database;

using var client = new MilvusClientV2(new ConnectConfig
{
    Uri = "localhost:19530",
    Username = "root",
    Password = "Milvus"
});
await client.ConnectAsync();

ListDatabasesResp response = await client.ListDatabasesAsync(new ListDatabasesReq());

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?