Answer the question
In order to leave comments, you need to log in
Why won't it let me connect to the localhost?
I installed mongodb on the vds itself (Ubuntu 20), when checking the status it shows the asset.
Connecting via code
MongoClient.connect("mongodb://localhost:21017/", {
useNewUrlParser: true,
authSource: "admin",
useUnifiedTopology: true
}, function (err, database) {
if (err) {
console.error('An error occurred connecting to MongoDB: ', err);
} else {
db = database.db("bot");
}
});
An error occurred connecting to MongoDB: MongoInvalidArgumentError: No AuthProvider for DEFAULT defined.
Handle polling update error: TypeError: Cannot read property 'collection' of undefined
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