Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jnosql-dev] add cont() method to the MongoDBTemplate

Hi all,

Could you add the count() method to the MongoDBTemplate ?
Currently I use select(collectionName, bson).count(), but this is a huge performance hog.

Something like:

    /**
     * Returns the number of items in the collection that match the given query filter.
     *
     * @param collectionName the collection name
     * @param filter         the query filter
     * @return the number of documents from query
     * @throws NullPointerException when filter or collectionName is null
     */
    long count(String collectionName, Bson filter);

Thank you.

Dmitry


Back to the top