Announcement Announcement Module
Collapse
No announcement yet.
MongoDB repositories and count methods Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    The same problem for me

    I've the same Issue! It's not possible to do this through Repository...
    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

    Comment

    Working...
    X