module.exports.bootstrap = function(cb) { // Ensure we have 2dsphere index on coordinates attribute of Place. sails.models.place.native(function (err, collection) { collection.ensureIndex({ coordinates: '2dsphere' }, function () { // It's very important to trigger this callback method when you are finished // with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap) cb(); }); }); };