In Mongo db I have some sample data as follows:
Object 1
{
'id': 1,
'name': 'ram',
'age': 25,
'group': 'developer',
'salary': 30000
}
Object 2
{
'id': 2,
'name': 'sai',
'age': 27,
'group': 'developer',
'salary': 45000
}
This is some sample data in the mongodb and I have so many objects all related to employee details.
From this data how to get the 1st or 2nd or 3rd highest salary and the details. So query should be like if i want 3rd highest salary it has to give me the all the details of matching document even if the salary is changed. The query should not need to be changed if the salary is increased.