Article For
4.0 4.1 4.2 5.1 5.2 5.3

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 {

    private int countOfDocuments;
    private int countOfConflicts;
    private Map<String, Long> collections;

    public CollectionStatistics() {
        collections = new HashMap<>();

    public Map<String, Long> getCollections() {
        return collections;

    public void setCollections(Map<String, Long> collections) {
        this.collections = collections;

    public int getCountOfDocuments() {
        return countOfDocuments;

    public void setCountOfDocuments(int countOfDocuments) {
        this.countOfDocuments = countOfDocuments;

    public int getCountOfConflicts() {
        return countOfConflicts;

    public void setCountOfConflicts(int countOfConflicts) {
        this.countOfConflicts = countOfConflicts;
Return Value
CountOfDocuments int Total documents count
CountOfConflicts int Total conflicts count
Collections Map<String, long> Maps collection name to document count


CollectionStatistics stats = store.maintenance().send(new GetCollectionStatisticsOperation());