Company: DIT intern hiring test
Difficulty: medium
Output of a MongoDB find with limit Chained Before sort The following documents are inserted into a newly created people collection in MongoDB. db.people.insertMany([{ "_id" : 1, "name" : "Adam", "age" : 23, "job" : "painter" }, { "_id" : 2, "name" : "John", "age" : 45, "job" : "driver" }, { "_id" : 3, "name" : "Jake", "age" : 21, "job" : "director" }, { "_id" : 4, "name" : "Paul", "age" : 35, "job" : "writer" }, { "_id" : 5, "name" : "Laura", "age" : 33, "job" : "doctor" }, { "_id" : 6, "name" : "Ram", "age" : 56, "job" : "gardener" }]) What will be the output of the following query? db.people.find({age: {$gte: 35}}).limit(2).sort({job:1, name: 1})