Question: Which MongoDB shell query will sort the customer's collection by name descending?
- db.customers.sort({name: -1}.find({})
- db.customers.sort({name: -1})
- db.customers.find({}).sort({name: -1})
- db.customers.find({}).sort({name: 1})
Answer: The correct answer of the above question is Option C:db.customers.find({}).sort({name: -1})