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 Collection Statistics

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

Syntax

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

Example

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