跳到主要内容
版本:v3.0.x

getCollectionStats()

Returns the complete collection statistics map in addition to the entity count.

Java
public GetCollectionStatsResp getCollectionStats(GetCollectionStatsReq request)

Request Syntax

Java
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

Java
GetCollectionStatsResp response = client.getCollectionStats(GetCollectionStatsReq.builder()
.collectionName("books")
.build());
Map<String, String> stats = response.getStats();