Example usage for com.mongodb.client MongoCollection countDocuments

List of usage examples for com.mongodb.client MongoCollection countDocuments

Introduction

In this page you can find the example usage for com.mongodb.client MongoCollection countDocuments.

Prototype

long countDocuments(ClientSession clientSession);

Source Link

Document

Counts the number of documents in the collection.

Usage

From source file:io.lumeer.storage.mongodb.dao.collection.MongoDataDao.java

License:Open Source License

@Override
public long getDataCount(final String collectionId, final SearchQuery query) {
    final MongoCollection<Document> collection = dataCollection(collectionId);
    return collection.countDocuments(createFilter(collectionId, query));
}