getCollectionStats()
Returns the complete collection statistics map in addition to the entity count.
public GetCollectionStatsResp getCollectionStats(GetCollectionStatsReq request)
Request Syntax
GetCollectionStatsReq.builder()
.databaseName(databaseName)
.collectionName(collectionName)
.build();
BUILDER METHODS:
-
databaseName(String databaseName)The name of the database. Defaults to the current database when omitted.
-
collectionName(String collectionName)The name of the target collection.
RETURNS:
GetCollectionStatsResp
Contains numOfEntities and the complete stats map returned by Milvus.
EXCEPTIONS:
-
MilvusClientException
Raised when request validation, transport, or server execution fails. Inspect the exception message for the exact failure reason.
Example
GetCollectionStatsResp response = client.getCollectionStats(GetCollectionStatsReq.builder()
.collectionName("books")
.build());
Map<String, String> stats = response.getStats();