Answer Posted / Rahul Bhatia
In MongoDB, creating an index can be done using the following syntax: `db.collection.createIndex( { field1: -1 } `. The `field1` refers to the field you want to index and the `-1` indicates ascending or descending order of the index (in this case, it is descending).
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers