Operations: How to Get Database Statistics

GetStatisticsOperation will retrieve database statistics like: count of documents, indexes, attachments, and more.

Syntax

public GetStatisticsOperation()
Return Value
DatabaseStatistics Database statistics

Example

DatabaseStatistics stats = store.Maintenance.Send(new GetStatisticsOperation());
long countOfDocuments = stats.CountOfDocuments;
long countOfIndexes = stats.CountOfIndexes;
bool isStale = stats.Indexes[0].IsStale;