0

I can't connect to the online database in my api giving a mongoError: auth failed

when i use

mongoose.connect("mongodb://myusername:my password@ds039674.mongolab.com:39674heroku_rlz2hh1h");

but when i use mongo cli it connects without any problems.

mongo ds ds039674.mongolab.com:39674heroku_rlz2hh1h -u myusername -p mypassword 

I am using the default generated app of the Heroku step by step guide https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up

DaanF
  • 179
  • 1
  • 11
  • Are you using a MongoDB 3.0 compatible mongoose driver? http://docs.mongodb.org/manual/release-notes/3.0-compatibility/#driver-compatibility-changes – pneumee Oct 16 '15 at 20:27
  • @pneumee thanks that was to problem npm install mongoose doesn't install the most recent version but an older version – DaanF Oct 16 '15 at 21:44
  • Great! disclaimer: I work @MongoLab. Always feel free to write our support team with any issues you may encounter: support@mongolab.com – pneumee Oct 16 '15 at 21:49

0 Answers0