0

I use JPA data Mongo DB and crudrepository, Now I need a method to calculate median. This is the main method which I need to get a median price.

findByDateBetweenAndInstrumentIdOrderByPriceDesc

Is it possible throw defined words in JPA?

Jens Schauder
  • 70,783
  • 26
  • 162
  • 317
Narges
  • 1,235
  • 5
  • 13
  • 28

1 Answers1

0

No that's not possible.

You have to use Mongo aggregation framework:

Calculate the median in MongoDB aggregation framework

Simon Martinelli
  • 27,740
  • 3
  • 37
  • 65