connect-mongo: Error: Error setting TTL index on collection : sessions
Hi, When My App Tries To Connect To The DB I Get This Error:
/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:529
throw err;
^
Error: Error setting TTL index on collection : sessions
at module.exports._get_collection (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/lib/connect-mongo.js:137:23)
at Db.ensureIndex (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:1227:28)
at Db.indexInformation (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:1371:30)
at Cursor.toArray (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/cursor.js:156:22)
at Cursor.nextObject.self.queryRun (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/cursor.js:611:39)
at Cursor.close (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/cursor.js:939:5)
at Cursor.nextObject.commandHandler (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/cursor.js:611:21)
at Db._executeQueryCommand (/Users/Ari/Dev/ArisGame/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:1709:18)
at g (events.js:192:14)
at EventEmitter.emit (events.js:126:20)
Iām Sorry, This Is All I Really Know
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 32 (2 by maintainers)
Commits related to this issue
- fix(server): fix setting TTL index on collection : sessions error — committed to angular-fullstack/generator-angular-fullstack by DaftMonk 10 years ago
- according to https://github.com/kcbanner/connect-mongo/issues/65 add reconnect mongo db to avoid 'Error setting TTL index on collection' — committed to wizicer/nodeclub by wizicer 9 years ago
Hi everyone, I tried to install traider.io in my local machine and I also met this error:
After searched, as I know because the version of connect-mongo & mongodb is not compatible. So, in my case, I re-installed mongodb with this version & it works:
Hope this help for someone like me š