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
  • 77,657
  • 34
  • 181
  • 348
Narges
  • 1,345
  • 6
  • 14
  • 29

1 Answers1

0

No that's not possible.

You have to use Mongo aggregation framework:

Calculate the median in MongoDB aggregation framework

Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82