You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 5.1 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.


public GetStatisticsOperation()
Return Value
DatabaseStatistics Database statistics


DatabaseStatistics stats = store.maintenance().send(new GetStatisticsOperation());
long countOfDocuments = stats.getCountOfDocuments();
int countOfIndexes = stats.getCountOfIndexes();
boolean isStale = stats.getIndexes()[0].isStale();