MCQs > IT & Programming > MongoDB > Suppose we have a collection of users with different ages. Which call will find the oldest person with the name John?

MongoDB MCQs

Suppose we have a collection of users with different ages. Which of the following calls will find the oldest person with the name John?

Answer

Correct Answer: db.users.aggregate({$match: {name: "John"}}, {$sort: {age: -1}}, {$limit: 1});

Explanation:

Note: This Question is unanswered, help us to find answer for this one

MongoDB Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

MongoDB Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it