Given next object structure:
class Foo {
@Id
String id;
LocalDate date;
...
}
We store these objects in MongoDB. Is there any possibility to get entity with the latest date via MongoRepository like in the next example?
interface FooRepository extends MongoRepository<Foo, String> {
@Query(???)
Foo getByLatestDate(LocalDate date);
}