Sundar Bons
Sundar Bons

Reputation: 119

Mongodb connection error ECONNRESET

When I tried to connect to mangolab, I get Err ECONNRESET

var mongo = require("mongodb").MongoClient;
var assert = require('assert');

var url = "mongodb://username:password@urlForServer:port/databaseName";
mongo.connect(url, function(err, db) {
    console.log(err);
});

I have put right info in connection url. please help. ECONNRESET Error Thanks in advance.

Upvotes: 0

Views: 15227

Answers (2)

Kirill Husiatyn
Kirill Husiatyn

Reputation: 828

For me, option wtimeoutMS=0 did the trick

Upvotes: 0

filype
filype

Reputation: 8380

I had a similar issue and it was due to corporate network restrictions which could be your case also

Your network may not allow this type of connection to this external address and port

Upvotes: 8

Related Questions