{"action":"closed","issue":{"url":"https://api.github.com/repos/kcbanner/connect-mongo/issues/216","repository_url":"https://api.github.com/repos/kcbanner/connect-mongo","labels_url":"https://api.github.com/repos/kcbanner/connect-mongo/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/kcbanner/connect-mongo/issues/216/comments","events_url":"https://api.github.com/repos/kcbanner/connect-mongo/issues/216/events","html_url":"https://github.com/kcbanner/connect-mongo/issues/216","id":135334032,"number":216,"title":"Error connecting to mongodb for the second time","user":{"login":"avihebbar","id":4043964,"avatar_url":"https://avatars.githubusercontent.com/u/4043964?v=3","gravatar_id":"","url":"https://api.github.com/users/avihebbar","html_url":"https://github.com/avihebbar","followers_url":"https://api.github.com/users/avihebbar/followers","following_url":"https://api.github.com/users/avihebbar/following{/other_user}","gists_url":"https://api.github.com/users/avihebbar/gists{/gist_id}","starred_url":"https://api.github.com/users/avihebbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avihebbar/subscriptions","organizations_url":"https://api.github.com/users/avihebbar/orgs","repos_url":"https://api.github.com/users/avihebbar/repos","events_url":"https://api.github.com/users/avihebbar/events{/privacy}","received_events_url":"https://api.github.com/users/avihebbar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-22T06:51:58Z","updated_at":"2016-02-23T07:44:45Z","closed_at":"2016-02-23T07:44:45Z","body":"Hi,\r\nI am trying to use the MongoStore with MongoDB connection string. Whenever I set up a  MongoStore with a new collection, it works fine. But after the app restarts, I get the following error. \r\n\r\n> /home/workspace/test/node_modules/mongodb/lib/mongodb/connection/base.js:246\r\n        throw message;      \r\n        ^\r\n\r\n> TypeError: Cannot read property 'length' of undefined\r\n  at processResults (/home/workspace/test/node_modules/mongodb/lib/mongodb/db.js:1603:31)\r\n  at /home/workspace/test/node_modules/mongodb/lib/mongodb/db.js:1641:20\r\n  at /home/workspace/test/node_modules/mongodb/lib/mongodb/db.js:1179:7\r\n  at /home/workspace/test/node_modules/mongodb/lib/mongodb/db.js:1912:9\r\n  at Server.Base._callHandler (/home/workspace/test/node_modules/mongodb/lib/mongodb/connection/base.js:448:41)\r\n  at /home/workspace/test/node_modules/mongodb/lib/mongodb/connection/server.js:481:18\r\n  at [object Object].MongoReply.parseBody (/home/workspace/test/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)\r\n  at [object Object].<anonymous> (/home/workspace/test/node_modules/mongodb/lib/mongodb/connection/server.js:439:20)\r\n  at emitOne (events.js:77:13)\r\n  at [object Object].emit (events.js:169:7)\r\n  at [object Object].<anonymous> (/home/workspace/test/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)\r\n  at emitTwo (events.js:87:13)\r\n  at [object Object].emit (events.js:172:7)\r\n  at Socket.<anonymous> (/home/workspace/test/node_modules/mongodb/lib/mongodb/connection/connection.js:439:22)\r\n  at emitOne (events.js:77:13)\r\n  at Socket.emit (events.js:169:7)\r\n  at readableAddChunk (_stream_readable.js:146:16)\r\n  at Socket.Readable.push (_stream_readable.js:110:10)\r\n  at TCP.onread (net.js:523:20) \r\n\r\nThe issue gets fixed if I change the **collection** in the options, but the same issue repeats after a restart. \r\n\r\nAnything that I am missing that can fix this issue?\r\n\r\nThanks,"}}