Back
I want to create Index on Mongo database for performance perspective, so could you please help me how I can do it?
Your help will be appreciated here.
To create an index on MongoDB you can use the below-mentioned query:
db.collection.createIndex(keys, options)
So, for example:
$ db.users.createIndex({"username" : 1})
31k questions
32.8k answers
501 comments
693 users