from pymilvus import Collection
collection = Collection("book") # Get an existing collection.
collection.schema # Return the schema.CollectionSchema of the collection.
collection.description # Return the description of the collection.
collection.name # Return the name of the collection.
collection.is_empty # Return the boolean value that indicates if the collection is empty.
collection.num_entities # Return the number of entities in the collection.
collection.primary_field # Return the schema.FieldSchema of the primary key field.
collection.partitions # Return the list[Partition] object.
collection.indexes # Return the list[Index] object.
await milvusClient.collectionManager.describeCollection({ // Return the name and schema of the collection.collection_name: "book",
});
await milvusClient.collectionManager.getCollectionStatistics({ // Return the statistics information of the collection.collection_name: "book",
});
collDesc, err := milvusClient.DescribeCollection( // Return the name and schema of the collection.
context.Background(), // ctx"book", // CollectionName
)
if err != nil {
log.Fatal("failed to check collection schema:", err.Error())
}
log.Printf("%v\n", collDesc)
collStat, err := milvusClient.GetCollectionStatistics( // Return the statistics information of the collection.
context.Background(), // ctx"book", // CollectionName
)
if err != nil {
log.Fatal("failed to check collection statistics:", err.Error())
}
R<DescribeCollectionResponse> respDescribeCollection = milvusClient.describeCollection(
// Return the name and schema of the collection.
DescribeCollectionParam.newBuilder()
.withCollectionName("book")
.build()
);
DescCollResponseWrapperwrapperDescribeCollection=newDescCollResponseWrapper(respDescribeCollection.getData());
System.out.println(wrapperDescribeCollection);
R<GetCollectionStatisticsResponse> respCollectionStatistics = milvusClient.getCollectionStatistics(
// Return the statistics information of the collection.
GetCollectionStatisticsParam.newBuilder()
.withCollectionName("book")
.build()
);
GetCollStatResponseWrapperwrapperCollectionStatistics=newGetCollStatResponseWrapper(respCollectionStatistics.getData());
System.out.println("Collection row count: " + wrapperCollectionStatistics.getRowCount());
describe collection -c book
Parameter
Description
schema
The schema of the collection.
description
The description of the collection.
name
The name of the collection.
is_empty
A boolean value that indicates whether the collection is empty.