I\'m trying to build a RESTful API with Spring Boot using spring-boot-starter-data-rest. There are some entities: accounts, transactions, categories and users - just the usu
You do not need to create your own controller to limit query results or sort the results. Just create a query method in your repository:
public interface TransactionRepository extends MongoRepository {
List findFirst10ByOrderByDateDesc();
}
Spring Data REST will automatically export it as a method resource at /transactions/search/findFirst10ByOrderByDateDesc.