MongoDB Query to find record using greater $gt or less than $lt operators and then sort
Query
db.grades.find({"score":{$gt:65}},{"score":1,student_id:2,}).sort({"score:1})
grades is the collection.
Query
db.grades.find({"score":{$gt:65}},{"score":1,student_id:2,}).sort({"score:1})
grades is the collection.