spring-projects / spring-data-mongodb

Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-mongodb/
Apache License 2.0
1.62k stars 1.09k forks source link

Add support for sorting and paging for criteria based queries [DATAMONGO-1481] #2398

Open spring-projects-issues opened 8 years ago

spring-projects-issues commented 8 years ago

Bob Tiernay opened DATAMONGO-1481 and commented

Currently this is not possible:

http://stackoverflow.com/questions/17255932/is-it-possible-to-use-springdata-mongodb-repository-to-execute-an-arbitrary-quer

However, this looks like it is possible with JPA and Specification. This is a very desirable feature for Spring Data REST when a user wants to find by one or more attributes supplied as query params. It would be nice to have parity with JPA in this regard


Reference URL: http://stackoverflow.com/questions/17255932/is-it-possible-to-use-springdata-mongodb-repository-to-execute-an-arbitrary-quer

1 votes, 3 watchers

spring-projects-issues commented 8 years ago

Andy Yang commented

Currently, while we can define custom queries, we would have to define a separate query for every permutation of our search fields. So, having Spring Data Repositories support Specification or Criteria objects would be greatly appreciated - getting the paging behaviour provided by the repository interfaces would be a really big win.

spring-projects-issues commented 6 years ago

Peter Dodok commented

No progress in this area. Specification are really handy, so support for this feature in mongo will be handy too.Is there any plan for this?

christophstrobl commented 1 year ago

We don't want to add query nor criteria into the repository layer and recommend custom implementations or usage of Querydsl if needed.