1

I am working on Spring data mongo with my Spring MVC application. I need to understand which is the correct way to improve performance if I wish to use multiple criteria's.

  • Do I need to go for Repository methods? Or
  • Do I need to go for MongoTemplate/MongoOperations?

Which is advisable to use to improve performance with many contional criteria's ?

  • [This SO answer](https://stackoverflow.com/questions/17008947/whats-the-difference-between-spring-datas-mongotemplate-and-mongorepository) was helpful for this question. – Karthikeyan Jun 19 '19 at 05:07

1 Answers1

0

from their doc

By default the repositories will get a MongoTemplate Spring bean wired that is called mongoTemplate, so you only need to configure mongo-template-ref explicitly if you deviate from this convention.

if we are talking about performance it is not dependant which of two you will choose. The performance depends on your indexes.

Nikolay Rusev
  • 4,060
  • 3
  • 19
  • 29