How do you create a descending index on the 'age' field in MongoDB? - Study24x7
Social learning Network
5 followers study24x7 19 Dec 2024 12:53 PM study24x7 study24x7

How do you create a descending index on the 'age' field in MongoDB?

A

db.collection.createIndex({age: -1})

B

db.collection.createIndex({age: "desc"})

C

db.collection.createIndex({age: 0})

D

db.collection.createIndex({age: "descending"})

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles