BatchDescribeCollectionsAsync()
Describes multiple collections at once, by name and/or collection ID.
public async Task<IReadOnlyList<DescribeCollectionResp>> BatchDescribeCollectionsAsync(BatchDescribeCollectionsReq request, CancellationToken cancellationToken = default)
Request Syntax
var request = new BatchDescribeCollectionsReq
{
CollectionNames = ["my_collection", "user"]
};
IReadOnlyList<DescribeCollectionResp> results = await client.BatchDescribeCollectionsAsync(request);
REQUEST PARAMETERS:
DatabaseName(string?) -An optional database name to operate on. When empty, the client’s currently selected database is used.
CollectionNames(IReadOnlyList) - The names of the collections to describe.
CollectionIds(IReadOnlyList) - The IDs of the collections to describe.
RETURN TYPE:
Task
RETURNS:
A read-only list of DescribeCollectionResp objects, one per described collection.
DescribeCollectionResp
CollectionId // -> long
CollectionName // -> string
Schema // -> CollectionSchema
ShardsNum // -> int
ConsistencyLevel // -> ConsistencyLevel
CreatedTimestamp // -> ulong
UpdateTimestamp // -> ulong
DatabaseName // -> string
NumPartitions // -> long?
CreatedUtcTimestamp // -> ulong
Aliases // -> IReadOnlyList<string>
Properties // -> IReadOnlyDictionary<string, string>
PARAMETERS:
CollectionId (long) -
The collection ID.
CollectionName (string) -
The collection name.
Schema (CollectionSchema) -
The collection schema. See CollectionSchema.
ShardsNum (int) -
The number of shards.
ConsistencyLevel (ConsistencyLevel) -
The consistency level of the collection. See ConsistencyLevel.
CreatedTimestamp (ulong) -
The hybrid timestamp at which the collection was created.
UpdateTimestamp (ulong) -
The hybrid timestamp at which the collection’s schema was last updated (e.g. by a field or property change).
DatabaseName (string) -
The database the collection belongs to, as reported by the server.
NumPartitions (long?) -
The number of default physical partitions, populated for a partition-key collection;
nullwhen not applicable.CreatedUtcTimestamp (ulong) -
The UTC timestamp at which the collection was created, as reported by the server.
Aliases (IReadOnlyList
) - The aliases of the collection.
Properties (IReadOnlyDictionary
) - The collection-level properties (e.g. TTL, consistency override, timezone), as set at creation time or via
AlterCollectionProperties.
EXCEPTIONS:
-
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.Collection;
using Milvus.Client.V2.Responses.Collection;
using var client = new MilvusClientV2(new ConnectConfig
{
Uri = "localhost:19530",
Username = "root",
Password = "Milvus"
});
await client.ConnectAsync();
IReadOnlyList<DescribeCollectionResp> results = await client.BatchDescribeCollectionsAsync(
new BatchDescribeCollectionsReq
{
CollectionNames = ["my_collection", "user"]
});