I'm having great difficulty getting any sort of connection to MongoDB on Appfog for session storage working. I'm currently running Node Express with PassportJS and Mongoose. I've followed numerous examples and tutorials online and tried a few ODM mappers.
I must confess, I've struggled to get any sort of connection let alone, the abstracted sessions stuff working.
I've tried the SO examples here and here without success. Everytime I attempt to connect with the following code:-
var env = process.env.NODE_ENV || 'development',
config = require('./config/config')[env],
auth = require('./config/middlewares/authorization'),
mongoose = require('mongoose');
// Bootstrap db connection
mongoose.connect(config.db);
I get a:-
Error: Error setting TTL index on collection : sessions
at module.exports._get_collection (/var/lib/stickshift/514a22705973cafc85000110/app-root/data/447240/node_modules/connect-mongo/lib/connect-mongo.js:137:23)
at Db.ensureIndex (/var/lib/stickshift/514a22705973cafc85000110/app-root/data/447240/node_modules/mongodb/lib/mongodb/db.js:1227:28)
at Db.indexInformation (/var/lib/stickshift/514a22705973cafc85000110/app-root/data/447240/node_modules/mongodb/lib/mongodb/db.js:1371:30)
Can anyone offer any possible direction or help to get this working please?
Please ask if you need further dumps of the code here to aid a solution.
Help appreciated.