I've build a nest.js server and now I'm trying to connect mongoDB Atlas. In the app.module imports i've tried to connect with
mongodb+srv://<user>:<pass>@cluster0.iijhz.mongodb.net/<dbName>?retryWrites=true&w=majority
url string, but failed, now i've tried these options too:
imports: [
MongooseModule.forRoot(
'mongodb+srv://cluster0.iijhz.mongodb.net',
{
user: '<user>',
pass: '<pass>',
dbName: '<dbName>',
w: 'majority',
retryWrites: true
}
),
but still got
MongoError: Authentication failed.
my ip, and 0.0.0.0/0 is also added to whitelist.