I am trying to connect to a mongodb atlas free cluster. however the error tells me that connection string can not contain multiple hostnames.
I am dirrectly copying atlas connection string and replacing password. I have no idea where does multiple hostnames come from.
my code looks like this:
mongoose.connect(dbUrl, {useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true
}).then((res) => console.log(res)).catch((error) => console.log(error));
my dbUrl is mongodb+srv://erdem:@mongootrial.dcxhh.mongodb.net/myFirstDatabase?retryWrites=true&w=majority