I am getting a mongoose connection error.

45 views
Skip to first unread message

That GenZ Gamer

unread,
Jan 12, 2022, 4:11:33 AM1/12/22
to Mongoose Node.JS ODM
My error is attached and the code is below.
---
const mongoose = require("mongoose");

connect().catch((err) => console.log(err));

async function connect() {
        await mongoose.connect(
                "mongodb://admin:mypassword@ip:port/?authSource=admin",
                {
                        useNewUrlParser: true,
                        useUnifiedTopology: true,
                },
        );

        mongoose.disconnect();
}
Screenshot 2022-01-12 143941.png
Reply all
Reply to author
Forward
0 new messages