Answer the question
In order to leave comments, you need to log in
How to connect to MongoDb on a remote server?
Installed the latest MongoDb on a separate server ( win 7 )
Raised it as a service according to the
instructions devcolibri.com/2091
I run mongo.exe on the same server in the console and can view the contents of the database, create objects, delete, etc.
I'm trying to connect from a script from another computer,
'use strict';
var url = 'mongodb://10.55.###.###:27017/test',
MongoClient = require('mongodb').MongoClient;
MongoClient.connect(url, (err, db) => {
if (err) {
console.error(err);
} else {
console.log('Connected correctly to server');
db.close();
}
});
[MongoError: failed to connect to server [10.55.###.###:27017] on first connect]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question