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
  • 65,795
  • 24
  • 148
  • 294
Narges
  • 1,165
  • 5
  • 12
  • 27

1 Answers1

0

No that's not possible.

You have to use Mongo aggregation framework:

Calculate the median in MongoDB aggregation framework

Simon Martinelli
  • 21,335
  • 3
  • 26
  • 53