Question: How can you create an index in MongoDB?Answer: You can create an index in MongoDB using the `createIndex` method. For example, `db.collection.createIndex({ field: 1 })` creates an ascending index on the specified field. |
Is it helpful?
Yes
No
Most helpful rated by users: