I have the following configuration:
"mongoose": { "url": "mongodb://127.0.0.1:27017/chat", "options": { "server": { "socketOptions": { "keepAlive": 1 } } } }
And connect to my db
mongoose.connect(config.get('mogoose:url'), config.get('mongoose:options'))
But I get this error:
node_modules/mongoose/node_modules/mongodb/lib/server.js:236 process.nextTick(function() { throw err; }) ^ Error: getaddrinfo ENOTFOUND undefined undefined:27017 at errnoException (dns.js:27:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:78:26)
I already checked the answers to the simular question .
I am very new to Mongo, but the following code works fine using my own driver:
var MongoClient = require('mongodb').MongoClient , format = require('util').format; MongoClient.connect('mongodb://127.0.0.1:27017/chat', function(err, db) { if (err) throw err;
Therefore, the answers to this question are not relevant in my case.
source share