You are currently browsing legacy 4.0 version of documentation. Click here to switch to the newest 5.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Operations: How to Get Collection Statistics

GetCollectionStatisticsOperation is used to return total count of documents, conflicts and document count in each collection.


public GetCollectionStatisticsOperation()

public class CollectionStatistics
    public int CountOfDocuments { get; set; }
    public int CountOfConflicts { get; set; }

    public Dictionary<string, long> Collections { get; set; }
Return Value
CountOfDocuments int Total documents count
CountOfConflicts int Total conflicts count
Collections Dictionary<string, long> Dictionary which maps collection name to document count


CollectionStatistics stats = store.Maintenance.Send(new GetCollectionStatisticsOperation());