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());