Results 1 to 2 of 2

Thread: MongoDB repositories and count methods

  1. #1
    Join Date
    Jan 2012
    Posts
    5

    Default MongoDB repositories and count methods

    I am evaluating spring-data / mongodb.

    from what I can tell, the spring-data-commons does not yet support automatically generating count methods. e.g. "countByName".

    also, there does not appear to be an operator in the mongo JSON syntax for counting. so I would be unable to use the @Query annotation.

    am I right in assuming that my only option to do counting from my repository is to mixin a custom bean which uses MongoTemplate?

    cheers

  2. #2
    Join Date
    May 2009
    Location
    Rome
    Posts
    22

    Default The same problem for me

    I've the same Issue! It's not possible to do this through Repository...
    Quote Originally Posted by LurgidBee View Post
    I am evaluating spring-data / mongodb.

    from what I can tell, the spring-data-commons does not yet support automatically generating count methods. e.g. "countByName".

    also, there does not appear to be an operator in the mongo JSON syntax for counting. so I would be unable to use the @Query annotation.

    am I right in assuming that my only option to do counting from my repository is to mixin a custom bean which uses MongoTemplate?

    cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •