MongoDB Interview Questions and Answers
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. |
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Is it helpful? Yes No
Most helpful rated by users: