Spring Data Mongo - lookup vs client side filtering

Viewed 37

I am new to Spring and MongoDB. Trying to identify that when I had to process records from more than one collection, is it better option to do a lookup or go for writing code in spring or go for lookup?

1 Answers

It cannot be explicit to decide due to the following reasons.

  1. Data size
  2. Number of collections which will be part of lookup
  3. Index usage
  4. Query efficiency.

It's better to evaluate both the options and decide. This is a good article to understand schema design

Related