{"action":"created","issue":{"url":"https://api.github.com/repos/LearnBoost/mongoose/issues/1740","labels_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/1740/labels{/name}","comments_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/1740/comments","events_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/1740/events","html_url":"https://github.com/LearnBoost/mongoose/issues/1740","id":21033340,"number":1740,"title":"`authdb` option not working","user":{"login":"frty2","id":684286,"avatar_url":"https://avatars.githubusercontent.com/u/684286?v=3","gravatar_id":"","url":"https://api.github.com/users/frty2","html_url":"https://github.com/frty2","followers_url":"https://api.github.com/users/frty2/followers","following_url":"https://api.github.com/users/frty2/following{/other_user}","gists_url":"https://api.github.com/users/frty2/gists{/gist_id}","starred_url":"https://api.github.com/users/frty2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frty2/subscriptions","organizations_url":"https://api.github.com/users/frty2/orgs","repos_url":"https://api.github.com/users/frty2/repos","events_url":"https://api.github.com/users/frty2/events{/privacy}","received_events_url":"https://api.github.com/users/frty2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LearnBoost/mongoose/labels/help","name":"help","color":"FFFFFF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2013-10-15T18:01:20Z","updated_at":"2015-03-21T01:25:03Z","closed_at":"2015-03-05T23:37:00Z","body":"using \r\n\r\n        var connectionString = 'mongodb://' + config.database.username + ':' + config.database.password + '@' + config.database.host + ':' + config.database.port + '/' + dbname;\r\n        var connection = mongoose.createConnection(connectionString);\r\n\r\neverything is replaced fine. user is create via mongo shell db.addUser() and has role 'readWriteAnyDatabase'. User can connect via mongo shell and query the db. But not via mongoose.\r\n\r\n        MongoError: not authorized for query on punch.shops\r\n        >>     at Object.toError (/var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/utils.js:110:11)\r\n        >>     at /var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:634:54\r\n        >>     at Cursor.close (/var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:903:5)\r\n        >>     at commandHandler (/var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:634:21)\r\n        >>     at /var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1670:9\r\n        >>     at Server.Base._callHandler (/var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:382:41)\r\n        >>     at /var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:472:18\r\n        >>     at MongoReply.parseBody (/var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)\r\n        >>     at null.<anonymous> (/var/www/virtual/punch/html/punch/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:430:20)\r\n        >>     at EventEmitter.emit (events.js:95:17)\r\n        >> Exited with code: 8."},"comment":{"url":"https://api.github.com/repos/LearnBoost/mongoose/issues/comments/84215142","html_url":"https://github.com/LearnBoost/mongoose/issues/1740#issuecomment-84215142","issue_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/1740","id":84215142,"user":{"login":"johnkors","id":206726,"avatar_url":"https://avatars.githubusercontent.com/u/206726?v=3","gravatar_id":"","url":"https://api.github.com/users/johnkors","html_url":"https://github.com/johnkors","followers_url":"https://api.github.com/users/johnkors/followers","following_url":"https://api.github.com/users/johnkors/following{/other_user}","gists_url":"https://api.github.com/users/johnkors/gists{/gist_id}","starred_url":"https://api.github.com/users/johnkors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnkors/subscriptions","organizations_url":"https://api.github.com/users/johnkors/orgs","repos_url":"https://api.github.com/users/johnkors/repos","events_url":"https://api.github.com/users/johnkors/events{/privacy}","received_events_url":"https://api.github.com/users/johnkors/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T01:25:03Z","updated_at":"2015-03-21T01:25:03Z","body":"still an issue. Can connect thru mongo 3.0 shell, but not thru mongoose"}}