Create an index on a document in MongoDB
Answer:
To create an index on a document in MongoDB, you can enter the shell and execute the statement like:
db.test.ensureIndex({ "fieldName": 1 })
(Assume you need to create index on fieldName of the test collection.)
That's easy?