Distinct in Spring Data MongoDB
Hat jemand versucht, die Aufnahme vondistinct
in ihrer Abfrage mitSpring Data for Mongo
. Wenn Sie ein Beispiel haben, können Sie es bitte posten. Wo und wie soll ich das @ einfügdistinct flag
?
Link zum Spring Data Mongo-Beispiel -Example 4.4. Query creation from method names
// Enables the distinct flag for the query
List<Person> findDistinctPeopleByLastnameOrFirstname(String lastname, String firstname);
List<Person> findPeopleDistinctByLastnameOrFirstname(String lastname, String firstname);