You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

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;