ListPartitionsAsync()

Lists the partitions of a collection.

public async Task<ListPartitionsResp> ListPartitionsAsync(ListPartitionsReq request, CancellationToken cancellationToken = default)

Request Syntax

var request = new ListPartitionsReq
{
    CollectionName = "my_collection"
};

ListPartitionsResp response = await client.ListPartitionsAsync(request);

REQUEST PARAMETERS:

  • DatabaseName (string?) -

    An optional database name to operate on. When empty, the client’s currently selected database is used.

  • CollectionName (string) -

    The name of the collection to list the partitions of.

RETURN TYPE:

Task

RETURNS:

A ListPartitionsResp object that contains the list of partitions.

ListPartitionsResp
    PartitionNames       // -> IReadOnlyList<string>
    PartitionIds         // -> IReadOnlyList<long>
    CreatedTimestamps    // -> IReadOnlyList<ulong>
    CreatedUtcTimestamps // -> IReadOnlyList<ulong>
    InMemoryPercentages  // -> IReadOnlyList<long>

PARAMETERS:

  • PartitionNames (IReadOnlyList) -

    The names of the partitions in the collection.

  • PartitionIds (IReadOnlyList) -

    The IDs of the partitions in the collection.

  • CreatedTimestamps (IReadOnlyList) -

    The hybrid timestamps at which the partitions were created, aligned with PartitionNames.

  • CreatedUtcTimestamps (IReadOnlyList) -

    The UTC timestamps at which the partitions were created, aligned with PartitionNames.

  • InMemoryPercentages (IReadOnlyList) -

    The percentage of each partition loaded into memory, aligned with PartitionNames.

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.Partition;
using Milvus.Client.V2.Responses.Partition;

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

ListPartitionsResp response = await client.ListPartitionsAsync(new ListPartitionsReq
{
    CollectionName = "my_collection"
});

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?