I know that there are many questions about this problem, but any of them solved my problem. I'm actually trying to deploy my project to Heroku, which is something new for me.
My project is a node.js based on the Express API connected to the MongoDB database. When I run it locally with my database (without login / password), I do not have this error, but when I connect it to the heroku database, I get:
Error: Error setting TTL index on collection : Session <MongoError: not authorized for query on app17713548.system.indexes>
My .json package
"dependencies": { "express": "3.0.6", "mongodb": "1.3.19", "mongoskin": "0.5.0", "MD5": "1.0.3", "connect-session": "*", "connect-mongo": "0.3.3", "geoip-lite": "1.0.10" }, "engines": { "node": "0.8.19", "npm": "1.1.65" }
And to connect to my database, I use MongoSkin, and the line:
mongo.db(conf.dbLogin+':'+conf.dbPassword+'@'+conf.dbAddr+':'+conf.dbPort+'/'+conf.dbName+'?auto_reconnect=true', {w: 1});
Any help would be greatly appreciated!
source share