I am using Node.js and MongoDB with Mongoose. I am connecting to Mongoose form Node.js as,
db = mongoose.connect('mongodb://localhost/my_database_name')
How can configure once in node.js to create index on collection ?
The directory structure of my App is, based on this tutorial:
HTML views/
Angular.js public/javascript/
Express.js routes/
Node.js app.js
Mongoose js models/, set up in app.js
Mongo db set up in app.js
Guide me on how to give index on a MongoDB collection form Node.js.