I wonder if there\'s any mechanism to use count in Spring Data MongoDB repository with @Query annotation? I would love to receive the number of doc
count
@Query
Another way to do this using MongoRepository query templates:
public interface MyRepository extends MongoRepository { Long countByLastname(String lastname); }
See http://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#repositories.query-methods.details