Skip to main content

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

Hi, Dmitry!

I hope you're doing well!

I've just opened a PR with this enhancement: https://github.com/eclipse/jnosql-databases/pull/228 

*PS*: This feature is not part of the Jakarta NoSQL spec. It's part of the Eclipse JNoSQL implementation only.

Thanks for the message!

Regards,

Max


On Wed, Jun 21, 2023 at 11:19 AM Dmitry Repchevsky via jnosql-dev <jnosql-dev@xxxxxxxxxxx> wrote:

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

_______________________________________________
jnosql-dev mailing list
jnosql-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jnosql-dev

Back to the top