MongoDB get minimum value in Java
To get/find a minimum value from a collection in MongoDB is similar to getting a min value from a column in SQL.
Corresponding SQL query is similar to this
Consider a collection called loan created as below
Let's find out the loan category having maximum interest rate among the three inserted in the collection above:
This example above has 3 interest rates 12 - Home Loans, 14 - Personal Loans, 16 - Car Loans
To get the minimum loan value use below query
Java Example :