Shurly is a simple, dependency free, Node.js module for ensuring indexes in MongoDb.
npm install shurly
var shurly = require('shurly'); shurly.ensure({ mongo: mongo, collections: [{ name: 'webpages', fields: ['url', 'ok'] }] }, function (err, ensured) { if (err) { console.log(err); } else { console.log(ensured); } });