I\'m using MongoDB for our web application. Assume there will be a \'find()\' on MongoDB for incoming requests. What is the recommended way/place to add index on a MongoDB c
I would put it when you initialize the application. If the collection does not exist when you call ensureIndex, the index (and collection) will be created at that time.
I am assuming that you know a priori what kinds of queries you will be running on the data, and what kind of data you will be putting into the index, of course.