You can use the db.collection.createIndex() method for creating Indexes in MongoDB.
db.collection.createIndex()