I have list of documents on mongodb like
Id, name, surname, salary.
I want all documents would return which contains max salary
.
I know that i should aggregate the query in two step.
- First of all, I should find max value of salar field for all documents,
- and after then i should find all documents where salary equals maxValue.
But i cannot configure it neither JPA nor native query approach. How can i make it happen?